<!DOCTYPE html><html class="hide-aside" lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><title>Win10:Hexo+github搭建个人博客 | Akilarの糖果屋</title><meta name="keywords" content="📁Hexo,🍨Win10,💻git"><meta name="author" content="Akilar"><meta name="copyright" content="Akilar"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="Windows系统下搭建Hexo+github的教程，包括主题配置以及博客管理。"><meta property="og:type" content="article"><meta property="og:title" content="Win10:Hexo+github搭建个人博客"><meta property="og:url" content="https://akilar.top/posts/6ef63e2d/"><meta property="og:site_name" content="Akilarの糖果屋"><meta property="og:description" content="Windows系统下搭建Hexo+github的教程，包括主题配置以及博客管理。"><meta property="og:locale" content="zh_CN"><meta property="og:image" content="https://img.zcool.cn/community/01f28461e1626511013f01cd1d05d8.jpg?x-oss-process=image/auto-orient,1/resize,m_lfit,w_1280,limit_1/sharpen,100/format,webp/quality,q_100"><meta property="article:published_time" content="2019-04-09T23:03:00.000Z"><meta property="article:modified_time" content="2021-08-09T15:42:00.000Z"><meta property="article:author" content="Akilar"><meta property="article:tag" content="📁Hexo"><meta property="article:tag" content="🍨Win10"><meta property="article:tag" content="💻git"><meta name="twitter:card" content="summary"><meta name="twitter:image" content="https://img.zcool.cn/community/01f28461e1626511013f01cd1d05d8.jpg?x-oss-process=image/auto-orient,1/resize,m_lfit,w_1280,limit_1/sharpen,100/format,webp/quality,q_100"><link rel="shortcut icon" href="https://npm.elemecdn.com/akiblog@1.0.1/img/siteicon/favicon.png"><link rel="canonical" href="https://akilar.top/posts/6ef63e2d/" media="defer" onload='this.media="all"'><link rel="preconnect" href="//cdn.jsdelivr.net"><link rel="preconnect" href="//at.alicdn.com/"><link rel="preconnect" href="//cdnjs.cloudflare.com/"><link rel="preconnect" href="//sdk.51.la"><meta name="google_site_verification" content="INnh6jnldNB3hxjSoa9ut7Kd9xX9R6Mqe7807EJsbCc"><meta name="baidu-site-verification" content="code-6O1kXu3a70"><meta name="msvalidate.01" content="3A07763DBFF970229752E8DF7999C30D"><link rel="manifest" href="/manifest.json"><link rel="apple-touch-icon" sizes="180x180" href="https://npm.elemecdn.com/akiblog@1.0.1/img/image/siteicon/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="https://npm.elemecdn.com/akiblog@1.0.1/img/siteicon/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="https://npm.elemecdn.com/akiblog@1.0.1/img/siteicon/favicon-16x16.png"><link rel="mask-icon" href="https://npm.elemecdn.com/akiblog@1.0.1/img/siteicon/safari-pinned-tab.svg" color="#5bbad5"><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://npm.elemecdn.com/@fortawesome/fontawesome-free@6.1.2/css/all.min.css" media="print" onload='this.media="all"'><link rel="stylesheet" href="https://npm.elemecdn.com/node-snackbar@0.1.16/dist/snackbar.min.css" media="print" onload='this.media="all"'><div class="js-pjax"><script charset="UTF-8" id="LA_COLLECT" src="https://sdk.51.la/js-sdk-pro.min.js"></script><script>LA.init({id:"JdyxkljyWpUOuTqt",ck:"JdyxkljyWpUOuTqt"})</script></div><script src="https://sdk.51.la/perf/js-sdk-perf.min.js" crossorigin="anonymous"></script><script>(new LingQue.Monitor).init({id:"JdzAJUCrdUGoOC7D"})</script><link rel="stylesheet" href="https://npm.elemecdn.com/akiblog@1.0.1/css/animate.min.css" media="print" onload='this.media="screen"'><link rel="stylesheet" href="https://npm.elemecdn.com/swiper@8.4.2/swiper-bundle.min.css" media="print" onload='this.media="all"'><script>const GLOBAL_CONFIG={root:"/",algolia:{appId:"STO7Z288QA",apiKey:"dbcfd77c89c49f19b42d68e572943881",indexName:"akilar",hits:{per_page:3},languages:{input_placeholder:"搜索文章",hits_empty:"找不到您查询的内容：${query}",hits_stats:"找到 ${hits} 条结果，用时 ${time} 毫秒"}},localSearch:void 0,translate:{defaultEncoding:2,translateDelay:0,msgToTraditionalChinese:"<i>繁</i><sapn>簡繁轉換</span>",msgToSimplifiedChinese:"<i>简</i><sapn>简繁转换</span>"},noticeOutdate:{limitDay:30,position:"top",messagePrev:"It has been",messageNext:"days since the last update, the content of the article may be outdated."},highlight:{plugin:"highlighjs",highlightCopy:!0,highlightLang:!0,highlightHeightLimit:130},copy:{success:"吾辈宣布你的剪贴板已经被我占领啦！",error:"抱歉，复制好像出了点问题。",noSupport:"你的浏览器好像不支持"},relativeDate:{homepage:!1,post:!1},runtime:"天",date_suffix:{just:"刚刚",min:"分钟前",hour:"小时前",day:"天前",month:"个月前"},copyright:void 0,lightbox:"mediumZoom",Snackbar:{chs_to_cht:"你已切换为繁体",cht_to_chs:"你已切换为简体",day_to_night:"你已切换为深色模式",night_to_day:"你已切换为浅色模式",bgLight:"#49B1F5",bgDark:"#1f1f1f",position:"top-center"},source:{justifiedGallery:{js:"https://npm.elemecdn.com/flickr-justified-gallery@2.1.2/dist/fjGallery.min.js",css:"https://npm.elemecdn.com/flickr-justified-gallery@2.1.2/dist/fjGallery.css"}},isPhotoFigcaption:!0,islazyload:!0,isAnchor:!1}</script><script id="config-diff">var GLOBAL_CONFIG_SITE={title:"Win10:Hexo+github搭建个人博客",isPost:!0,isHome:!1,isHighlightShrink:!1,isToc:!0,postUpdate:"2021-08-09 15:42:00"}</script><noscript><style>#nav{opacity:1}.justified-gallery img{opacity:1}#post-meta time,#recent-posts time{display:inline!important}</style></noscript><script>(e=>{e.saveToLocal={set:function(e,t,o){if(0===o)return;const a=864e5*o,n={value:t,expiry:(new Date).getTime()+a};localStorage.setItem(e,JSON.stringify(n))},get:function(e){const t=localStorage.getItem(e);if(!t)return;const o=JSON.parse(t);if(!((new Date).getTime()>o.expiry))return o.value;localStorage.removeItem(e)}},e.getScript=e=>new Promise((t,o)=>{const a=document.createElement("script");a.src=e,a.async=!0,a.onerror=o,a.onload=a.onreadystatechange=function(){const e=this.readyState;e&&"loaded"!==e&&"complete"!==e||(a.onload=a.onreadystatechange=null,t())},document.head.appendChild(a)}),e.activateDarkMode=function(){document.documentElement.setAttribute("data-theme","dark"),null!==document.querySelector('meta[name="theme-color"]')&&document.querySelector('meta[name="theme-color"]').setAttribute("content","#0d0d0d")},e.activateLightMode=function(){document.documentElement.setAttribute("data-theme","light"),null!==document.querySelector('meta[name="theme-color"]')&&document.querySelector('meta[name="theme-color"]').setAttribute("content","#ffffff")};const t=saveToLocal.get("theme"),o=(new Date).getHours();void 0===t?o<=6||o>=18?activateDarkMode():activateLightMode():"light"===t?activateLightMode():activateDarkMode();const a=saveToLocal.get("aside-status");void 0!==a&&("hide"===a?document.documentElement.classList.add("hide-aside"):document.documentElement.classList.remove("hide-aside"));/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)&&document.documentElement.classList.add("apple")})(window)</script><link rel="stylesheet" href="https://npm.elemecdn.com/akiblog@1.0.1/css/custom.css" media="defer" onload='this.media="all"'><link rel="stylesheet" href="https://widget.heweather.net/simple/static/css/he-simple.css?v=1.4.0" media="defer" onload='this.media="all"'><script src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/SAO-Notify.js" async></script><script async src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/carousel-touch.js"></script><svg aria-hidden="true" style="position:absolute;overflow:hidden;width:0;height:0"><symbol id="icon-sun" viewBox="0 0 1024 1024"><path d="M960 512l-128 128v192h-192l-128 128-128-128H192v-192l-128-128 128-128V192h192l128-128 128 128h192v192z" fill="#FFD878" p-id="8420"></path><path d="M736 512a224 224 0 1 0-448 0 224 224 0 1 0 448 0z" fill="#FFE4A9" p-id="8421"></path><path d="M512 109.248 626.752 224H800v173.248L914.752 512 800 626.752V800h-173.248L512 914.752 397.248 800H224v-173.248L109.248 512 224 397.248V224h173.248L512 109.248M512 64l-128 128H192v192l-128 128 128 128v192h192l128 128 128-128h192v-192l128-128-128-128V192h-192l-128-128z" fill="#4D5152" p-id="8422"></path><path d="M512 320c105.888 0 192 86.112 192 192s-86.112 192-192 192-192-86.112-192-192 86.112-192 192-192m0-32a224 224 0 1 0 0 448 224 224 0 0 0 0-448z" fill="#4D5152" p-id="8423"></path></symbol><symbol id="icon-moon" viewBox="0 0 1024 1024"><path d="M611.370667 167.082667a445.013333 445.013333 0 0 1-38.4 161.834666 477.824 477.824 0 0 1-244.736 244.394667 445.141333 445.141333 0 0 1-161.109334 38.058667 85.077333 85.077333 0 0 0-65.066666 135.722666A462.08 462.08 0 1 0 747.093333 102.058667a85.077333 85.077333 0 0 0-135.722666 65.024z" fill="#FFB531" p-id="11345"></path><path d="M329.728 274.133333l35.157333-35.157333a21.333333 21.333333 0 1 0-30.165333-30.165333l-35.157333 35.157333-35.114667-35.157333a21.333333 21.333333 0 0 0-30.165333 30.165333l35.114666 35.157333-35.114666 35.157334a21.333333 21.333333 0 1 0 30.165333 30.165333l35.114667-35.157333 35.157333 35.157333a21.333333 21.333333 0 1 0 30.165333-30.165333z" fill="#030835" p-id="11346"></path></symbol></svg><link rel="stylesheet" href="https://npm.elemecdn.com/hexo-filter-gitcalendar/lib/gitcalendar.css" media="print" onload='this.media="all"'><meta name="generator" content="Hexo 6.2.0"><link rel="alternate" href="/atom.xml" title="Akilarの糖果屋" type="application/atom+xml"></head><body><div id="loading-box"><div class="ark-loading" id="ark-loading"><div class="ark-loading-top-container"><div class="ark-loading-top-left-flash"></div><div class="ark-loading-top-left-border"></div><div class="ark-loading-top-triangle"></div><div class="ark-loading-top-right-border"></div><div class="ark-loading-top-right-flash"></div></div><div class="ark-loading-bottom-container"><div class="ark-loading-bottom-left-border"></div><div class="ark-loading-bottom-left-triangle"></div><div class="ark-loading-bottom-center-border"></div><div class="ark-loading-bottom-right-triangle"></div><div class="ark-loading-bottom-right-border"></div></div><div class="ark-loading-main-container"><div class="ark-loading-content"><div class="ark-loading-power-left"></div><div class="ark-loading-center-left-border"></div><div class="ark-loading-cab-outside-border"><div class="ark-loading-cab-insideborder"><div class="ark-loading-cab-container"><div class="ark-loading-percentage"></div><div class="ark-loading-tip"></div></div></div></div><div class="ark-loading-center-right-border"></div><div class="ark-loading-power-right"></div></div></div></div></div><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="" data-lazy-src="https://npm.elemecdn.com/akiblog@1.0.1/img/author.webp" onerror='onerror=null,src="https://npm.elemecdn.com/akiblog@1.0.1/img/404.gif"' alt="avatar"></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">480</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">63</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">6</div></a></div><hr><div class="menus_items"><div class="menus_item"><a class="site-page faa-parent animated-hover" href="/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-laptop"></use></svg> <span>博客</span></a></div><div class="menus_item"><a class="site-page faa-parent animated-hover" href="/archives/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-Calendar"></use></svg> <span>时间轴</span></a></div><div class="menus_item"><a class="site-page faa-parent animated-hover" href="/tags/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-strategy"></use></svg> <span>标签</span></a></div><div class="menus_item"><a class="site-page faa-parent animated-hover" href="/fcircle/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-forumdiscusstion"></use></svg> <span>朋友圈</span></a></div><div class="menus_item"><a class="site-page faa-parent animated-hover" href="/link/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-connection"></use></svg> <span>友人帐</span></a></div><div class="menus_item"><a class="site-page faa-parent animated-hover" href="/comments/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-letter"></use></svg> <span>留言板</span></a></div><div class="menus_item"><a class="site-page group faa-parent animated-hover" href="javascript:void(0);" rel="external nofollow noreferrer"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-hourglass"></use></svg> <span>生活</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="faa-parent animated-hover site-page child" href="/gallery/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-strategy"></use></svg> <span>相册</span></a></li><li><a class="faa-parent animated-hover site-page child" href="/bangumis/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-unicorn"></use></svg> <span>追番</span></a></li><li><a class="faa-parent animated-hover site-page child" href="/about/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-Achievement"></use></svg> <span>关于</span></a></li></ul></div><div class="menus_item"><a class="site-page faa-parent animated-hover" href="javascript:toRandomPost()" rel="external nofollow noreferrer"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-teamwork"></use></svg> <span>随便看看</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image:url(https://img.zcool.cn/community/01f28461e1626511013f01cd1d05d8.jpg?x-oss-process=image/auto-orient,1/resize,m_lfit,w_1280,limit_1/sharpen,100/format,webp/quality,q_100)"><div class="menu-container" id="menu-container"><div class="menu-item"><div class="menu-item-main"><a class="site-page faa-parent animated-hover" href="/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-laptop"></use></svg> <span>博客</span></a></div><div class="menu-item-main"><a class="site-page faa-parent animated-hover" href="/archives/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-Calendar"></use></svg> <span>时间轴</span></a></div><div class="menu-item-main"><a class="site-page faa-parent animated-hover" href="/tags/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-strategy"></use></svg> <span>标签</span></a></div><div class="menu-item-main"><a class="site-page faa-parent animated-hover" href="/fcircle/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-forumdiscusstion"></use></svg> <span>朋友圈</span></a></div><div class="menu-item-main"><a class="site-page faa-parent animated-hover" href="/link/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-connection"></use></svg> <span>友人帐</span></a></div><div class="menu-item-main"><a class="site-page faa-parent animated-hover" href="/comments/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-letter"></use></svg> <span>留言板</span></a></div><div class="menu-item-main has-child"><div class="menu-item-parent"><a class="site-page faa-parent animated-hover" href="javascript:void(0);" rel="external nofollow noreferrer"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-hourglass"></use></svg> <span>生活</span></a></div><div class="menu-item-child"><a class="faa-parent animated-hover site-page child" href="/gallery/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-strategy"></use></svg> <span>相册</span></a></div><div class="menu-item-child"><a class="faa-parent animated-hover site-page child" href="/bangumis/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-unicorn"></use></svg> <span>追番</span></a></div><div class="menu-item-child"><a class="faa-parent animated-hover site-page child" href="/about/"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-Achievement"></use></svg> <span>关于</span></a></div></div><div class="menu-item-main"><a class="site-page faa-parent animated-hover" href="javascript:toRandomPost()" rel="external nofollow noreferrer"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-teamwork"></use></svg> <span>随便看看</span></a></div></div><div class="top-bar"><div class="message-container"><div class="message-item message-weather" onclick="btf.scrollToDest(0,500)"><div class="message-weather-box" id="he-plugin-simple"></div></div><div class="message-item message-date" onclick="Navvisible()"><div class="message-date-box" id="message-date-box"></div><div class="message-title-box" id="message-title-box"><a id="site-name" title="Windows系统下搭建Hexo+github的教程，包括主题配置以及博客管理。">Win10:Hexo+github搭建个人博客</a></div></div><div class="message-item message-function"><div id="search-button"><a class="site-page social-icon search faa-parent animated-hover"><svg class="faa-tada icon" style="height:25px;width:25px" aria-hidden="true"><use xlink:href="#icon-analitic"></use></svg> <span>搜索</span></a></div><a class="icon-V hidden faa-parent animated-hover" onclick="switchNightMode()" title="昼夜切换"><svg class="faa-tada" width="25" height="25" viewBox="0 0 1024 1024"><use id="modeicon" xlink:href="#icon-moon"></use></svg></a><div id="toggle-menu"><a class="site-page faa-parent animated-hover"><svg class="faa-tada icon" style="height:25px;width:25px" aria-hidden="true"><use xlink:href="#icon-MobileApps"></use></svg></a></div></div></div></div><button class="active-button" onclick="Navvisible()"></button></div><div id="post-info"><h1 class="post-title">Win10:Hexo+github搭建个人博客<a class="post-edit-link" href="https://github.com/Akilarlxh/Hexo-blog-source/edit/master/source/_posts/Akilarの棉花糖/Win10-Hexo+github搭建个人博客.md" rel="external nofollow noreferrer" title="编辑" target="_blank"><i class="fas fa-feather-alt faa-tada animated-hover"></i></a></h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2019-04-09T23:03:00.000Z" title="发表于 2019-04-09 23:03:00">2019-04-09</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2021-08-09T15:42:00.000Z" title="更新于 2021-08-09 15:42:00">2021-08-09</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%F0%9F%8D%A8Akilar%E3%81%AE%E6%A3%89%E8%8A%B1%E7%B3%96/">🍨Akilarの棉花糖</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">10.4k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>40分钟</span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h2 id="写在最前"><a href="#写在最前" class="headerlink" title="写在最前"></a>写在最前</h2><details class="folding-tag" cyan><summary>无聊的碎碎念不看也罢</summary><div class="content"><div class="note info flat"><p>最开始接触博客的契机是我第一次重装Ubuntu的时候。看的是<a target="_blank" rel="noopener external nofollow noreferrer" href="https://blog.vanxnf.top">楠皮的博客</a>，之后又重装了7次Ubuntu，每次都去看楠皮的博客，一个人撑起了他的博客访问量。自此，我终于意识到我也该写个博客了，一开始用到的是csdn，虽然csdn自带的网页markdown非常方便，还有快捷键支持，但是实在是架不住那边烦人的站点广告，之后也试过简书，虽然好看了许多，但是还是没有我当初浏览楠皮博客时那种丝般顺滑的感觉。</p></div><div class="note success flat"><p>最后，在无数个下定决心的双休日，我终于在前天，也即是20190407，记牢这个历史性的时刻，搭建成功了我的第一个个人博客，虽然还很简略，没什么文章，但是不急，把我那200多篇个人日记慢慢搬过来就好了。</p></div></div></details><h2 id="准备工作"><a href="#准备工作" class="headerlink" title="准备工作"></a>准备工作</h2><details class="folding-tag" red><summary>安装必要的软件</summary><div class="content"><div class="note default flat"><p>首先要安装必要的软件<br>如果下载速度过慢可以参考这篇教程:<a href="/posts/e332c532/">基于NDM和TamperMonkey脚本实现高速下载</a><br>以下五个软件中，<code>Node.js</code>和<code>git</code>为必要软件，后三者作为之后编写博客的<code>Markdown</code>编辑器，挑选一个使用即可。</p></div><div class="tabs" id="需要安装的软件"><ul class="nav-tabs"><li class="tab"><button type="button" data-href="#需要安装的软件-1">Node.js</button></li><li class="tab"><button type="button" data-href="#需要安装的软件-2">git</button></li><li class="tab"><button type="button" data-href="#需要安装的软件-3">Atom</button></li><li class="tab"><button type="button" data-href="#需要安装的软件-4">Typora</button></li><li class="tab"><button type="button" data-href="#需要安装的软件-5">Hexo-editor</button></li></ul><div class="tab-contents"><div class="tab-item-content" id="需要安装的软件-1"><p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://nodejs.org/en/">Node.js</a></p><div class="note danger no-icon flat"><p>我下载的是的<code>11.13.0</code>版本。（建议选择左边的稳定版本，右边的最新版本可能会出现莫名bug）<br>Node.js是基于Chrome的V8 JavaScript引擎构建的运行在服务端的JavaScript开发平台,知道这些就够了。<br>反正作为一个包管理器，安装以后再也不用去打扰它的具体配置。默默运行就是了。</p></div><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div><div class="tab-item-content" id="需要安装的软件-2"><p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://git-scm.com/">git</a></p><div class="note warning no-icon flat"><p>我下载的是<code>2.21.0</code>版本，可以选择安装版，也可以选择绿色版。<br>绿色版需要加上<code>Git_HOME</code>，<code>%Git_HOME%\bin</code>之类的环境变量，建议下载安装版一路默认安装，安装包会自动添加相应的环境变量。</p></div><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div><div class="tab-item-content" id="需要安装的软件-3"><p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/atom/atom/releases">Atom</a></p><div class="note info no-icon flat"><p><code>Atom</code>自带<code>markdown</code>渲染，<kbd>Shift</kbd>+<kbd>Ctrl</kbd>+<kbd>M</kbd>即可。而且安装简单。<br>界面美观，怎么吹都不过分啊。要是没有特殊需求的话这个就足够了。<br>事实上如果<code>Atom</code>安装了插件之后会很酷炫<br>插件安装教程和推荐可以参考这篇教程:<a href="/posts/498e6e74/">Atom插件安装和推荐</a>。</p></div><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div><div class="tab-item-content" id="需要安装的软件-4"><p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.typora.io/">Typora</a></p><div class="note success no-icon flat"><p>typora是一个专业的markdown编辑器，比之atom的最大优势就是同步渲染速度，缺点是对于代码高亮的支持并不是很方便，自带源代码模式 ，拿来看看代码也不错</p></div><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div><div class="tab-item-content" id="需要安装的软件-5"><p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/zhuzhuyule/HexoEditor/releases">HexoEditor</a></p><div class="note primary no-icon flat"><p><code>HexoEditor</code>是我目前一直最喜爱的一款<code>Markdown</code>编辑器，自带图片复制转<code>Markdown</code>链接，同时支持三种图床。具备各种快捷键，还能拖动文本，自带预览，对一些主题渲染有适配，没适配的也能通过导入相应的<code>tags</code>配置进行渲染。<br>有兴趣的可以看一下我专门为它写的配置教程:<a href="/posts/1da4f99e/">Hexo-editor——Hexo专用的编辑器</a></p></div><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div></div></div></div></details><h2 id="安装Hexo"><a href="#安装Hexo" class="headerlink" title="安装Hexo"></a>安装Hexo</h2><details class="folding-tag" orange><summary>点击查看Hexo安装教程</summary><div class="content"><div class="note primary flat"><p>首先给出官方网址:<a target="_blank" rel="noopener external nofollow noreferrer" href="https://hexo.io/zh-cn/">Hexo官网</a><br>内容仅供参考，具体搭建可以直接看下面的教程。放官网的目的是在这里可以找到全套的使用文档，而且hexo的作者是个台湾人，对中文的支持很不错。</p></div><ol><li>首先需要建立博客文件夹，建议建在非系统盘，例如<code>~D:/Hexo/</code>，那么这个目录就是我们博客的根目录了。<br>因为每个人的命名习惯不同，本帖之后会以<code>[Blogroot]</code>指代博客根目录。</li><li>使用<code>npm</code>安装<code>Hexo</code>,在<code>[Blogroot]</code>路径下<kbd>右键</kbd>-&gt;<kbd>Git Bash Here</kbd>,输入<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">npm config <span class="built_in">set</span> registry https://registry.npmmirror.com</span><br><span class="line"><span class="comment">#将npm源替换为阿里的镜像。之后的安装就会迅速很多了。</span></span><br><span class="line">npm install hexo-cli -g</span><br><span class="line"><span class="comment"># hexo-cli 是 hexo的指令集。</span></span><br><span class="line">hexo init</span><br><span class="line"><span class="comment"># 有了指令集以后，使用它的初始化指令来初始化安装Hexo博客。</span></span><br></pre></td></tr></table></figure></li><li>安装插件，依然是在<code>[Blogroot]</code>路径下<kbd>右键</kbd>-&gt;<kbd>Git Bash Here</kbd>，使用<code>npm</code>指令挑选需要的插件安装。(请仔细阅读注释，确定你是否需要安装这个插件)。<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-generator-index --save</span><br><span class="line"><span class="comment"># 主页插件，最新版Hexo默认安装，可跳过</span></span><br><span class="line">npm install hexo-generator-archive --save</span><br><span class="line"><span class="comment"># 归档插件，最新版Hexo默认安装，可跳过</span></span><br><span class="line">npm install hexo-generator-category --save</span><br><span class="line"><span class="comment"># 分类插件，最新版Hexo默认安装，可跳过</span></span><br><span class="line">npm install hexo-generator-tag --save</span><br><span class="line"><span class="comment"># 标签插件，最新版Hexo默认安装，可跳过</span></span><br><span class="line">npm install hexo-server --save</span><br><span class="line"><span class="comment"># 服务插件，最新版Hexo默认安装，可跳过</span></span><br><span class="line">npm install hexo-renderer-marked --save</span><br><span class="line"><span class="comment"># markdown渲染支持插件，最新版Hexo默认安装，可跳过</span></span><br><span class="line">npm install hexo-renderer-stylus --save</span><br><span class="line"><span class="comment"># nib css支持插件，如无需求，可跳过</span></span><br><span class="line">npm install hexo-generator-feed --save</span><br><span class="line"><span class="comment"># RSS订阅支持插件，如无需求，可跳过</span></span><br><span class="line">npm install hexo-generator-sitemap --save</span><br><span class="line"><span class="comment"># sitemap生成插件，帮助搜索引擎抓取，如无需求，可跳过</span></span><br><span class="line">npm install hexo-admin --save</span><br><span class="line"><span class="comment"># 网页端hexo文档管理插件，如无需求，可跳过</span></span><br><span class="line">npm install hexo-deployer-git --save</span><br><span class="line"><span class="comment"># git部署插件，必须安装</span></span><br></pre></td></tr></table></figure></li><li>常用命令<br><div class="note primary no-icon flat"><p>常用命令在这篇文章中有详细总结:<a href="/posts/803c5fab/">双系统-Hexo和github的常用命令行归纳</a></p></div><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">hexo clean</span><br><span class="line"><span class="comment">#清空缓存</span></span><br><span class="line">hexo generate</span><br><span class="line">hexo g <span class="comment">#简写</span></span><br><span class="line"><span class="comment">#重新编译</span></span><br><span class="line">hexo server</span><br><span class="line">hexo s <span class="comment">#简写</span></span><br><span class="line"><span class="comment">#打开本地访问</span></span><br><span class="line">hexo new &lt;layout&gt; <span class="string">&quot;文章title&quot;</span></span><br><span class="line"><span class="comment">#新建文章</span></span><br><span class="line">hexo deploy</span><br><span class="line">hexo d <span class="comment">#简写</span></span><br><span class="line"><span class="comment">#部署到云端</span></span><br></pre></td></tr></table></figure></li><li>本地预览：在<code>[Blogroot]</code>路径下<kbd>右键</kbd>-&gt;<kbd>Git Bash Here</kbd>，输入<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo server</span><br></pre></td></tr></table></figure><img src="" data-lazy-src="https://s2.ax1x.com/2019/04/09/AomUuq.png" alt="hexo server"><br>然后在浏览器中打开<code>localhost:4000</code> ,就能看到<br><img src="" data-lazy-src="https://s2.ax1x.com/2019/04/11/A7DdZq.png" alt="hello world"><br>如果你安装了<code>hexo-admin</code>插件，就可以通过访问<code>localhost:4000/admin</code>来管理你的文章了。并且在可视化界面中操作文章内容。恭喜你，博客的本地部署到这里算是告一段落了。</li><li>添加分类页面和标签页面<ul><li>添加分类页面<br>在<code>[Blogroot]</code>路径下<kbd>右键</kbd>-&gt;<kbd>Git Bash Here</kbd>，输入：<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">hexo new page categories</span><br><span class="line"><span class="comment"># 创建“分类”页面</span></span><br></pre></td></tr></table></figure>打开<code>[Blogroot]/sources/categories/index.md</code><br>在它的头部加上<code>type</code>属性。<figure class="highlight diff"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">  ---</span><br><span class="line">  title: categories</span><br><span class="line">  date: 2017-05-27 13:47:40</span><br><span class="line"><span class="addition">+ type: &quot;categories&quot;</span></span><br><span class="line">  ---</span><br></pre></td></tr></table></figure>给文章添加分类，例如我要给<code>Hello-world</code>这篇文章添加分类，打开<code>[Blogroot]/sources/_posts/Hello-woeld.md</code>,修改他的头部内容为：<figure class="highlight diff"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">  ---</span><br><span class="line">  title: Hello-World</span><br><span class="line">  date: 2019-04-07 00:38:36</span><br><span class="line"><span class="addition">+ categories: 学习笔记</span></span><br><span class="line">  tags: [node.js, hexo]</span><br><span class="line">  ---</span><br></pre></td></tr></table></figure></li><li>添加标签页面<br>在<code>[Blogroot]</code>路径下<kbd>右键</kbd>-&gt;<kbd>Git Bash Here</kbd>，输入：<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">hexo new page tags</span><br><span class="line"><span class="comment"># 创建“标签”页面</span></span><br></pre></td></tr></table></figure>打开<code>[Blogroot]/sources/tags/index.md</code><br>在它的头部加上<code>type</code>属性。<figure class="highlight diff"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">  ---</span><br><span class="line">  title: tags</span><br><span class="line">  date: 2017-05-27 13:47:40</span><br><span class="line"><span class="addition">+ type: &quot;tags&quot;</span></span><br><span class="line">  ---</span><br></pre></td></tr></table></figure>给文章添加标签，例如我要给<code>Hello-world</code>这篇文章添加标签，打开<code>[Blogroot]/sources/_posts/Hello-world.md</code>,修改他的头部内容为：<figure class="highlight diff"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">  ---</span><br><span class="line">  title: Hello-World</span><br><span class="line">  date: 2019-04-07 00:38:36</span><br><span class="line">  categories: 学习笔记</span><br><span class="line"><span class="addition">+ tags: [node.js, hexo]  # 逗号是英文逗号</span></span><br><span class="line">  ---</span><br></pre></td></tr></table></figure>第二种写法是用-短划线列出来<figure class="highlight diff"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">  ---</span><br><span class="line">  title: Hello-World</span><br><span class="line">  date: 2019-04-07 00:38:36</span><br><span class="line">  categories: 学习笔记</span><br><span class="line"><span class="addition">+ tags:</span></span><br><span class="line"><span class="addition">+   - node.js # 注意短线后有空格</span></span><br><span class="line"><span class="addition">+   - 📁Hexo</span></span><br><span class="line">  ---</span><br></pre></td></tr></table></figure></li></ul></li></ol></div></details><h2 id="部署到GitHub"><a href="#部署到GitHub" class="headerlink" title="部署到GitHub"></a>部署到GitHub</h2><details class="folding-tag" purple><summary>点击查看部署至github的教程</summary><div class="content"><ol><li>访问官网按照指示注册github账号:<a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/">github</a><details class="folding-tag" red><summary>注册过程中可能遇到的bug</summary><div class="content"><p>有些用户注册github账号时可能会遇到<code>Unable to verify your captcha response</code>报错。解决方案：</p><ul><li>升级浏览器内核：直接下载安装最新版chrome或者Microsoft edge浏览器即可。</li><li>把github域名添加到hosts文件中，可以自行百度，也可以参考这篇教程:<a href="/posts/61b3e163/">访问github或部署在gitpage上的网站过慢的解决方案</a></li></ul></div></details><ol><li>新建<code>username.github.io</code>仓库:<br>注册成功后，在github首页单击<kbd>头像</kbd>-&gt;<kbd>Your repositories</kbd><br>在自己的 GitHub 账号下创建一个新的仓库，命名为 <code>username.github.io</code>（username是你的账号名)。<details class="folding-tag" yellow><summary>科普：为什么要命名为username.github.io？</summary><div class="content"><div class="note warning flat"><p>专门写给老实孩子看的，这段主要是为了解释为啥要按照<code>username.github.io</code>这个要求来新建仓库名，不感兴趣的话跳过这段看后面的<code>配置Git 与 GitHub</code>就好，不用追根究底。<br>在这里，要知道，<code>GitHub Pages</code>有两种类型：<code>User/Organization Pages</code> 和 <code>Project Pages</code>，而我所使用的是 <code>User Pages</code>。<br>简单来说，<code>User Pages</code> 与 <code>Project Pages</code> 的区别是：</p><ul><li><code>User Pages</code> 是用来展示用户的，而 <code>Project Pages</code> 是用来展示项目的。</li><li>用于存放<code>User Pages</code>的仓库必须使用 <code>username.github.io</code> 的命名规则，而 <code>Project Pages</code>则没有特殊的要求。</li><li><code>User Pages</code>通过<code>https://username.github.io</code>进行访问，而<code>Projects Pages</code>通过<code>https://username.github.io/projectname</code>进行访问。</li></ul></div><div class="note info flat"><p>相关资料:<a target="_blank" rel="noopener external nofollow noreferrer" href="https://help.github.com/articles/user-organization-and-project-pages/">GitHub Pages Basics / User, Organization, and Project Pages</a></p></div></div></details></li><li><p>配置<code>Git</code>与<code>GitHub</code>:</p><ul><li>此处为全局配置，所以可以在任意位置打开<kbd>git bash</kbd>,设置用户名称和邮件地址<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git config --global user.name <span class="string">&quot;akilarlxh&quot;</span></span><br><span class="line">git config --global user.email <span class="string">&quot;akilarlxh@gmail.com&quot;</span></span><br></pre></td></tr></table></figure></li><li>设置完成后为了能够在本地使用<code>git</code>管理<code>github</code>上的项目，需要绑定<code>SSHkey</code>。<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">ssh-keygen -t rsa -C akilarlxh@gmail.com</span><br><span class="line"><span class="comment"># -C后面加你在github的用户名邮箱，这样公钥才会被github认可</span></span><br><span class="line">less ~/.ssh/id_rsa.pub</span><br><span class="line"><span class="comment"># 查看公钥内容稍后加入Github账户的sshkey中,</span></span><br></pre></td></tr></table></figure><div class="note warning flat"><p>这一步骤推荐在<code>git bash</code>中运行指令。若使用<code>powershell</code>或<code>cmd</code>，<code>less</code>指令缺少必要的C语言环境，需要访问<code>C:\Users\Username\.ssh\id_rsa.pub</code>复制。</p></div><img src="" data-lazy-src="https://s2.ax1x.com/2019/04/09/AoM9Re.png" alt="SSHkey"></li><li>打开<a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/">github网页</a><br>单击<kbd>头像</kbd>-&gt;<kbd>settings</kbd>,在设置页面找到<kbd>SSH and GPG keys</kbd>，单击<kbd>New SSH key</kbd>新建<code>SSH KEY</code>。<br><img src="" data-lazy-src="https://s2.ax1x.com/2019/04/09/AoMCxH.png" alt="gitkey"></li><li><p>保存后，在git bash测试sshkey是否添加成功，输入</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">ssh -T git@github.com</span><br><span class="line"><span class="comment"># Attempts to ssh to GitHub</span></span><br></pre></td></tr></table></figure></li><li><p>正常输出是</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">The authenticity of host <span class="string">&#x27;github.com (207.97.227.239)&#x27;</span> can<span class="string">&#x27;t be established.</span></span><br><span class="line"><span class="string">RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.</span></span><br><span class="line"><span class="string">Are you sure you want to continue connecting (yes/no)?</span></span><br><span class="line"><span class="string"># 此处请输入yes</span></span><br><span class="line"><span class="string">Hi username! You&#x27;</span>ve successfully authenticated, but GitHub does not</span><br><span class="line">provide shell access.</span><br></pre></td></tr></table></figure><details class="folding-tag" red><summary>配置过程中可能遇到的bug</summary><div class="content"><p>输出报错为<br></p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ssh: connect to host gitee.com port 22: Connection timed out</span><br></pre></td></tr></table></figure><br>这是由于在当前网络环境中，<emp>端口22被占用了</emp>，我们改用其他端口再试试<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">ssh -T -p 443 git@ssh.github.com</span><br><span class="line"><span class="comment"># -p 443表示使用443端口，要是443也被占用，也可以尝试其他端口</span></span><br></pre></td></tr></table></figure><p></p></div></details></li></ul></li><li>配置hexo部署插件内容：<ul><li>确保你安装了<code>hexo-deployer-git</code>,如果没有，在<code>[Blogroot]</code>路径下<kbd>右键</kbd>-&gt;<kbd>Git Bash Here</kbd>，输入：<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-deployer-git --save</span><br></pre></td></tr></table></figure></li><li>打开<code>[Blogroot]/_config.yml</code>,修改底部的<code>deploy</code>配置项。如果没有找到<code>deploy</code>配置项,则自己添加：<div class="note info flat"><p>感谢<a target="_blank" rel="noopener external nofollow noreferrer" href="https://musinn.github.io">@姬顶盒</a>的反馈，最新版<a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.npmjs.com/package/hexo-deployer-git">hexo-deployer-git</a>的配置项写法已经更新</p></div><figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 站点部署到github要配置Deployment</span></span><br><span class="line"><span class="comment">## Docs: https://zespia.tw/hexo/docs/deploy.html</span></span><br><span class="line"><span class="attr">deploy:</span></span><br><span class="line">  <span class="attr">type:</span> <span class="string">git</span></span><br><span class="line">  <span class="attr">repo:</span></span><br><span class="line">    <span class="attr">github:</span></span><br><span class="line">      <span class="attr">url:</span> <span class="string">git@github.com:username/username.github.io.git</span>  <span class="comment"># 记得把username替换为自己的用户名</span></span><br><span class="line">      <span class="attr">branch:</span> <span class="string">master</span> <span class="comment">#2020年10月后github新建仓库默认分支改为main，注意修改</span></span><br><span class="line">    <span class="comment"># 也可以用另一种写法,二选一即可</span></span><br><span class="line">    <span class="attr">github:</span> <span class="string">git@github.com:username/username.github.io.git,master</span></span><br></pre></td></tr></table></figure><div class="note warning flat"><p>这里<code>deploy</code>前面不要有<code>空格</code>，而所有<code>:</code>后面都要有空格。对齐缩进情况要严格按照示例来写。<code>yml</code>编译对缩进要求很严格，所以格式很重要。</p></div></li></ul></li><li>把本地<code>hexo</code>博客内容提交到<code>git</code>仓库<ul><li>若以上内容已经准确配置，在<code>[Blogroot]</code>路径下<kbd>右键</kbd>-&gt;<kbd>Git Bash Here</kbd>，输入：<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">hexo clean</span><br><span class="line">hexo generate</span><br><span class="line">hexo deploy</span><br></pre></td></tr></table></figure></li><li>不出意外，就可以在浏览器上输入<code>https://username.github.io</code>访问你的博客了。<br>（记得替换<code>username</code>为自己的用户名。<details class="folding-tag" red><summary>网页部署阶段可能出现的bug</summary><div class="content"><p>报错<code>ERROR Deployer not found: git</code></p><ul><li>git用户名和邮箱配置错误，<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git config --global user.name%<span class="string">&quot;username&quot;</span></span><br><span class="line">git config --global user.email%<span class="string">&quot;username@example.com&quot;</span></span><br></pre></td></tr></table></figure>这里的<code>%</code>，在正确的格式中是一个<code>空格</code>，如果你之前没有打空格，那么邮箱和用户名根本就没有记录进去。回退到这一步重新进行。</li><li><code>hexo-deployer-git</code>插件没有安装正确，重新在<code>[Blogroot]</code>路径下<kbd>右键</kbd>-&gt;<kbd>Git Bash Here</kbd>，执行：<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-deployer-git –save</span><br><span class="line"><span class="comment"># 重新安装之后，再尝试提交</span></span><br><span class="line">hexo deploy</span><br></pre></td></tr></table></figure></li></ul></div></details></li></ul></li></ol></li></ol></div></details><h2 id="域名配置"><a href="#域名配置" class="headerlink" title="域名配置"></a>域名配置</h2><details class="folding-tag" cyan><summary>点击查看域名配置</summary><div class="content"><p></p><div class="note success no-icon flat"><p>最后还是屈服于境泽定律，实在是<code>top</code>域名价格太美丽，首年只要<code>1元/年</code>，之后续费也是<code>25元/年</code>，折算下来比我买<code>v2ray</code>服务还便宜。</p></div><p></p><ol><li>购买域名<br><div class="note primary no-icon flat"><p>我使用了腾讯云的对象存储功能作为图床存储，考虑到续费便利性，就在腾讯云购买的<code>top</code>域名，其他的像阿里云的万网也是可行的。但是我个人推荐还是腾讯云比较好。腾讯云社区会时不时的发放代金券，可以抵扣腾讯云服务费用。</p></div><br><wavy>记得留意域名注册页面的活动优惠，直接购买域名是首年9元起步的，在活动里才能找到首年1元的选项，买的时候也要记得看之后的续费内容，不要花费多余的精力和金钱。</wavy><ul><li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://dnspod.cloud.tencent.com/">腾讯云域名注册</a></li><li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://wanwang.aliyun.com/">阿里云域名注册</a><br>购买成功后按照网站提示逐步完成域名实名认证和域名信息，等待下发域名证书。（审核速度很快，实名信息上传到电子证书下发还不到半小时）<br>关于备案：因为<code>Hexo</code>博客是托管在<code>github</code>上的，所以，除非你购买的域名是<code>.cn</code>后缀的，或者你给博客使用的某些插件需要部署在另外的云服务上这两种情况，否则是不需要备案的。</li></ul></li><li>绑定域名<br>为了能够使用自己的域名访问我们的博客，需要再进行域名绑定：<ul><li>首先要获取博客当前默认域名的<code>IP</code>,打开<code>cmd</code>或者<code>powershell</code>，输入<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">ping username.github.io</span><br><span class="line"><span class="comment"># username记得替换成你的用户名</span></span><br></pre></td></tr></table></figure><img src="" data-lazy-src="https://npm.elemecdn.com/akilar-candyassets/image/20200723100548766.png" alt=""></li><li>获取到的<code>ip</code>地址填入域名解析。<br>这里以腾讯云为例。进入<kbd>控制台</kbd>-&gt;<kbd>域名注册</kbd>-&gt;<kbd>我的域名</kbd>。在购买的域名的操作栏选择解析。<br><img src="" data-lazy-src="https://npm.elemecdn.com/akilar-candyassets/image/20200723101044570.png" alt=""></li></ul></li><li>进入解析页面后需要添加两条记录。<br><img src="" data-lazy-src="https://npm.elemecdn.com/akilar-candyassets/image/20200723101444765.png" alt=""><div class="note info flat"><p>关于为什么要添加两条记录。此处有必要说明一下，实质起作用的其实是第一条<code>A</code>记录，而第二条<code>CNAME</code>记录指向的其实是<code>www</code>的二级域名。例如此处指向<code>www.akilar.top</code>。然后当有人用<code>www.akilar.top</code>访问时，会重定向到<code>akilar.top</code>。emmm,虽然看起来有点多此一举啦，但是<a target="_blank" rel="noopener external nofollow noreferrer" href="https://android99.me">@安卓大佬</a>说这样可以提升访问成功几率。毕竟很多人习惯在域名前面敲个<code>www</code>。</p></div></li><li>在<code>[Blogroot]\source\</code>目录下新建<code>CNAME</code>文件（注意不要有后缀名，就叫<code>CNAME</code>即可，什么<code>.txt</code>、<code>.js</code>之类的后缀都不能有），在<code>CNAME</code>文件中添加上你购买的域名。<br><img src="" data-lazy-src="https://npm.elemecdn.com/akilar-candyassets/image/20200723101906965.png" alt=""></li><li>配置<code>username.github.io</code>仓库。<br>打开<code>username.github.io</code>，点击仓库页面右上角的<kbd>setting</kbd><br><img src="" data-lazy-src="https://npm.elemecdn.com/akilar-candyassets/image/20200723102148239.png" alt=""><br>下拉找到<kbd>Github Pages</kbd>栏，在<kbd>Custom domain</kbd>中填入你购买的域名。<br><img src="" data-lazy-src="https://npm.elemecdn.com/akilar-candyassets/image/20200723102314604.png" alt=""></li><li>最后，重新部署一下<code>hexo</code>即可通过你的域名来访问博客了。<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">hexo clean</span><br><span class="line">hexo generate</span><br><span class="line">hexo depoly</span><br></pre></td></tr></table></figure></li></ol></div></details><h2 id="主题配置"><a href="#主题配置" class="headerlink" title="主题配置"></a>主题配置</h2><div class="note primary flat"><p>本博客主题现已改用<a target="_blank" rel="noopener external nofollow noreferrer" href="https://butterfly.js.org/">Butterfly</a>，你可以直接访问<a target="_blank" rel="noopener external nofollow noreferrer" href="https://butterfly.js.org/">Butterfly主题官方文档</a>进行主题配置，相比NexT，Butterfly的功能高度集成化，仅仅只需在配置文件中修改true或false即可。本站效果美化方案参考<a href="/posts/f99b208/">基于Butterfly主题的美化日记</a></p></div><details class="folding-tag" blue><summary>NexT内容已经过于陈旧，不建议参考</summary><div class="content"><ol><li>安装NexT<div class="note info flat"><p>NexT主题，界面简洁但是功能强大。配置教程可以参考以下内容：</p><ul><li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://theme-next.iissnan.com/">NexT使用文档</a><br><span class="p center logo large">参考文章</span></li><li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.jianshu.com/p/21c94eb7bcd1">绝配：hexo+next主题及我走过的坑</a></li><li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://asdfv1929.github.io/2018/01/20/gitalk/">Hexo NexT主题中集成gitalk评论系统</a></li><li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://liujunzhou.top/2018/8/10/gitalk-error/">Hexo NexT使用Gitalk未找到相关的Issues进行评论Error:Validation Failed</a></li><li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://www.jianshu.com/p/608e4d2a511d">给Hexo Next添加本地搜索功能</a></li></ul></div><div class="note default no-icon flat"><p>我是用的git clone的方法，文档中还有其他方法。<br>在Hexo根目录文件夹中，打开git bash输入<br></p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">git <span class="built_in">clone</span> https://github.com/theme-next/hexo-theme-next themes/next</span><br><span class="line"><span class="comment"># 这个指令就是把NexT主题的项目文件拷贝到了[Blogroot]/themes/next 路径下。</span></span><br><span class="line"><span class="comment"># 建议找到[Blogroot]/themes/next文件夹，删除里面的.git文件夹。以免在提交到Git仓库时，因为有多个.git文件夹，导致提交出错。</span></span><br></pre></td></tr></table></figure><p></p></div></li><li>设置主题为NexT<div class="note default no-icon flat"><p>打开<code>[Blogroot]/_config.yml</code>,找到theme行设置主题<br></p><figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">theme:</span> <span class="string">next</span></span><br><span class="line"><span class="comment"># 默认是landscape</span></span><br></pre></td></tr></table></figure><p></p></div></li><li>配置NexT主题<div class="note info flat"><p>Hexo的配置文件分为站点配置文件和主题配置文件。</p><ul><li>站点配置文件：<code>[Blogroot]/_config.yml</code></li><li>主题配置文件：<code>[Blogroot]/themes/next/_config.yml</code><br>接下来我们就可以来按需配置主题内容了，<br>没有特别声明的，都在<code>~Hexo/themes/next</code>文件夹下的<code>_config.yml</code>文件里修改。</li></ul></div></li><li>站点 site<div class="note primary flat"><p>打开站点配置文件<code>[Blogroot]/_config.yml</code>，先来修改你的站点名称<br></p><figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># Site</span></span><br><span class="line"><span class="attr">title:</span> <span class="string">Akilarの糖果屋</span> <span class="string">//站点名称</span></span><br><span class="line"><span class="attr">subtitle:</span> <span class="string">Rookie</span> <span class="string">programmer&#x27;s</span> <span class="string">growth</span> <span class="string">diary</span> <span class="string">//站点副标题</span></span><br><span class="line"><span class="attr">description:</span> <span class="string">Nothing</span> <span class="string">is</span> <span class="literal">true</span><span class="string">,everything</span> <span class="string">is</span> <span class="string">premited</span> <span class="string">//站点描述</span></span><br><span class="line"><span class="attr">keywords:</span> <span class="string">diary;</span> <span class="string">experience;</span> <span class="string">tutorial;</span> <span class="string">//关键词</span></span><br><span class="line"><span class="attr">author:</span> <span class="string">Akilar</span> <span class="string">//作者</span></span><br><span class="line"><span class="attr">language:</span> <span class="string">zh-CN</span> <span class="string">//看themes/language下的文件是zh-Hans还是zh-CN</span></span><br><span class="line"><span class="attr">timezone:</span></span><br></pre></td></tr></table></figure><p></p></div><div class="note info flat"><p>官方文档里写的是有些配置需要将一部分代码添加到配置文件中，但其实不用，我们逐行看配置文件就会发现，有很多功能都已经放在配置文件里了，只是注释掉了，我们只需要取消注释，把需要的相关信息补全即可使用。</p></div><div class="note primary flat"><p>打开<code>[Blogroot]/themes/next/_config.yml</code></p></div></li><li>菜单栏 menu<div class="note default no-icon flat"><p>原生菜单栏有主页、关于、分类、标签等数个选项，但是在配置文件中是注释掉的状态，这里我们自行修改注释就行<br></p><figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">menu:</span></span><br><span class="line"><span class="attr">home:</span> <span class="string">/</span> <span class="string">||</span> <span class="string">home</span></span><br><span class="line"><span class="comment"># about: /about/ || user</span></span><br><span class="line"><span class="attr">tags:</span> <span class="string">/tags/</span> <span class="string">||</span> <span class="string">tags</span></span><br><span class="line"><span class="attr">categories:</span> <span class="string">/categories/</span> <span class="string">||</span> <span class="string">th</span></span><br><span class="line"><span class="attr">archives:</span> <span class="string">/archives/</span> <span class="string">||</span> <span class="string">archive</span></span><br><span class="line"><span class="comment"># schedule: /schedule/ || calendar</span></span><br><span class="line"><span class="comment"># sitemap: /sitemap.xml || sitemap</span></span><br><span class="line"><span class="comment"># commonweal: /404/ || heartbeat</span></span><br></pre></td></tr></table></figure><p></p></div><div class="note warning flat"><p>注意点：如果事先没有通过hexo new page “pageName”来创建页面的话，<br>即使在配置文件中取消注释，页面也没法显示<br>我们也可以添加自己想要添加的页面，不用局限在配置文件里提供的选择里<br>||后面是fontAwesome里的文件对应的名称<br>menu_icons记得选enable: true（默认应该是true）</p></div></li><li>主题风格 schemes<div class="note default no-icon flat"><p>主题提供了4个，把想要的主题分格前的注释取消，保持其他三个在注释掉的状态即可。</p></div><div class="tabs" id="schemes"><ul class="nav-tabs"><li class="tab active"><button type="button" data-href="#schemes-1">Muse</button></li><li class="tab"><button type="button" data-href="#schemes-2">Mist</button></li><li class="tab"><button type="button" data-href="#schemes-3">Pisces</button></li><li class="tab"><button type="button" data-href="#schemes-4">Gemini</button></li></ul><div class="tab-contents"><div class="tab-item-content active" id="schemes-1"><p><img src="" data-lazy-src="https://npm.elemecdn.com/akilar-candyassets/image/20200720051912433.png" alt=""></p><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div><div class="tab-item-content" id="schemes-2"><p><img src="" data-lazy-src="https://npm.elemecdn.com/akilar-candyassets/image/20200720051938307.png" alt=""></p><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div><div class="tab-item-content" id="schemes-3"><p><img src="" data-lazy-src="https://npm.elemecdn.com/akilar-candyassets/image/20200720052003513.png" alt=""></p><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div><div class="tab-item-content" id="schemes-4"><p><img src="" data-lazy-src="https://npm.elemecdn.com/akilar-candyassets/image/20200720052029789.png" alt=""></p><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div></div></div></li><li>底部建站时间和图标修改<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">footer:</span></span><br><span class="line"><span class="comment"># Specify the date when the site was setup.</span></span><br><span class="line"><span class="comment"># If not defined, current year will be used.</span></span><br><span class="line"><span class="attr">since:</span> <span class="number">2018</span></span><br><span class="line"><span class="comment"># Icon between year and copyright info.</span></span><br><span class="line"><span class="attr">icon:</span> <span class="string">snowflake-o</span></span><br><span class="line"><span class="comment"># 把用户的图标从小人user改成了雪花snowflake-o</span></span><br><span class="line"><span class="comment"># If not defined, will be used `author` from Hexo main config.</span></span><br><span class="line"><span class="attr">copyright:</span></span><br><span class="line"><span class="comment">#copyright留空，显示成页面author即我的名字</span></span><br><span class="line"><span class="comment"># -------------------------------------------------------------</span></span><br><span class="line"><span class="comment"># Hexo link (Powered by Hexo).</span></span><br><span class="line"><span class="attr">powered:</span> <span class="literal">false</span></span><br><span class="line"><span class="comment">#powered: false把hexo的授权图片取消了</span></span><br><span class="line"><span class="attr">theme:</span></span><br><span class="line"><span class="comment"># Theme &amp; scheme info link (Theme - NexT.scheme).</span></span><br><span class="line"><span class="attr">enable:</span> <span class="literal">false</span></span><br><span class="line"><span class="comment"># Version info of NexT after scheme info (vX.X.X).</span></span><br><span class="line"><span class="comment"># version: false</span></span><br><span class="line"><span class="comment">#theme: enable:false 把主题的内容也取消了</span></span><br></pre></td></tr></table></figure></li><li>个人社交信息 social<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">social:</span></span><br><span class="line"><span class="attr">GitHub:</span> <span class="string">https://github.com/akilarlxh</span> <span class="string">||</span> <span class="string">github</span></span><br><span class="line"><span class="attr">E-Mail:</span> <span class="string">mailto:akialrlxh@gmail.com</span> <span class="string">||</span> <span class="string">envelope</span></span><br><span class="line"><span class="comment">#Google: https://plus.google.com/yourname || google</span></span><br><span class="line"><span class="comment">#Twitter: https://twitter.com/yourname || twitter</span></span><br><span class="line"><span class="comment">#FB Page: https://www.facebook.com/yourname || facebook</span></span><br><span class="line"></span><br><span class="line"><span class="string">/*</span>  <span class="string">||后面对应的名称是fontAwesome里图标的名称，</span></span><br><span class="line"><span class="string">如果我们选择的账号没有对应的图标（如豆瓣、知乎），</span></span><br><span class="line"><span class="string">我们可以在fontAwesome库里去选择自己喜欢的图标</span></span><br><span class="line"><span class="string">建议不要找太新的fontAwesome图标，主题关联的</span></span><br><span class="line"><span class="string">库版本没有那么新，很可能显示不了或者显示一个地球*/</span></span><br></pre></td></tr></table></figure></li><li>网站动画效果 motion<br><div class="note default no-icon flat"><p>如果是为了网站响应速度我们可以把网站的动画关掉</p></div><figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">motion:</span></span><br><span class="line"><span class="attr">enable:</span> <span class="literal">false</span></span><br></pre></td></tr></table></figure><div class="note default no-icon flat"><p><del>但是写微博就是为了装B啊！如果不够酷炫谁要写博客啊，会睡着的好伐啦！</del><br>但我觉得页面比较素，所以开了动画，<br>主题自带四种效果，可以选自己喜欢的。<br>我选择的是canvas-nest</p></div><figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">motion:</span></span><br><span class="line"><span class="attr">enable:</span> <span class="literal">true</span></span><br><span class="line"><span class="attr">async:</span> <span class="literal">true</span></span><br><span class="line"><span class="comment"># Canvas-nest</span></span><br><span class="line"><span class="attr">canvas_nest:</span> <span class="literal">true</span></span><br><span class="line"><span class="comment"># three_waves</span></span><br><span class="line"><span class="attr">three_waves:</span> <span class="literal">false</span></span><br><span class="line"><span class="comment"># canvas_lines</span></span><br><span class="line"><span class="attr">canvas_lines:</span> <span class="literal">false</span></span><br><span class="line"><span class="comment"># canvas_sphere</span></span><br><span class="line"><span class="attr">canvas_sphere:</span> <span class="literal">false</span></span><br></pre></td></tr></table></figure></li><li>全局搜索功能 local search<br><div class="note info flat"><p>Local Search 由 flashlab 贡献,<br>在<a target="_blank" rel="noopener external nofollow noreferrer" href="https://theme-next.iissnan.com/third-party-services.html#local-search">next使用文档</a>里有完备的安装指导。</p></div><ul><li>安装 <code>hexo-generator-searchdb</code>，在站点的根目录下执行以下命令：<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-generator-search --save</span><br><span class="line">npm install hexo-generator-searchdb --save</span><br></pre></td></tr></table></figure></li><li>编辑 站点配置文件<code>[Blogroot]/_config.yml</code>，新增以下内容到任意位置：<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">search:</span></span><br><span class="line"><span class="attr">path:</span> <span class="string">search.xml</span></span><br><span class="line"><span class="attr">field:</span> <span class="string">post</span></span><br><span class="line"><span class="attr">format:</span> <span class="string">html</span></span><br><span class="line"><span class="attr">limit:</span> <span class="number">10000</span></span><br><span class="line"><span class="string">//search要顶格，“:”后要有空格，格式很重要。</span></span><br></pre></td></tr></table></figure></li><li>编辑 主题配置文件[Blogroot]/themes/next/_config.yml，启用本地搜索功能：<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># Local search</span></span><br><span class="line"><span class="attr">local_search:</span></span><br><span class="line"><span class="attr">enable:</span> <span class="literal">true</span></span><br></pre></td></tr></table></figure></li></ul></li></ol></div></details><h2 id="版本控制"><a href="#版本控制" class="headerlink" title="版本控制"></a>版本控制</h2><h3 id="源码存放方案：开源or闭源"><a href="#源码存放方案：开源or闭源" class="headerlink" title="源码存放方案：开源or闭源"></a>源码存放方案：开源or闭源</h3><div class="tabs" id="博客部署"><ul class="nav-tabs"><li class="tab"><button type="button" data-href="#博客部署-1">🔀源码保密，仅开源网页</button></li><li class="tab"><button type="button" data-href="#博客部署-2">🔁源码开源，双分支部署</button></li></ul><div class="tab-contents"><div class="tab-item-content" id="博客部署-1"><div class="note warning flat"><p>如果按照我现在的方式进行双分支部署，虽然可以在一个仓库内同时管理博客源码和博客生成的网页文件，但是基于<code>gitpage</code>必须是开放的性质，你的博客源码将是完全开源的，任何人都能通过<code>git clone</code>拷贝你的博客源码，唯一的区别就是在没有绑定<code>SSH Key</code>的情况下他们不可能提交到你的库内。</p></div><p>所以，对源码有保密需求的，可以参照以下方式另外新建一个保密仓库作为源码存放库。</p><ol><li><p>创建存放源码的私有仓库<br>我们需要创建一个用来存放<code>Hexo</code>博客源码的私有仓库<code>[SourceRepo]</code>，这点在<a href="/posts/6ef63e2d/">Win10</a>的<code>Hexo</code>博客搭建教程中有提到。为了保持教程的连贯，此处再写一遍。<br><img src="" data-lazy-src="https://npm.elemecdn.com/akilar-candyassets/image/PZ7wmiuX8ae9rVK.png" alt=""><br>创建完成后，需要把博客的源码<code>push</code>到这里。首先获取远程仓库地址，此处虽然<code>SSH</code>和<code>HTTPS</code>均可。<code>SSH</code>在绑定过<code>ssh key</code>的设备上无需再输入密码，<code>HTTPS</code>则需要输入密码，但是<code>SSH</code>偶尔会遇到端口占用的情况。请自主选择。<br><img src="" data-lazy-src="https://npm.elemecdn.com/akilar-candyassets/image/mpdUYJKcfWLQ2Eg.png" alt=""></p></li><li><p>在<code>[Blogroot]</code>路径下<kbd>右键</kbd>-&gt;<kbd>Git Bash Here</kbd>，输入</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git init <span class="comment"># 初始化git</span></span><br></pre></td></tr></table></figure><p>这一步会在你的博客目录下新建一个<code>.git</code>文件夹。因为是隐藏文件夹，所以需要你先确保当前目录下隐藏文件夹可见才能看到它。</p></li><li>在远端提交前，我们需要先调整一下屏蔽项，能够使用指令进行安装的内容不包括在需要提交的源码内，这样可以显著减少需要提交的文件量和加快提交速度。打开<code>[Blogroot]/.gitignore</code>（也是隐藏文件）,输入以下内容：<figure class="highlight txt"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">.DS_Store</span><br><span class="line">Thumbs.db</span><br><span class="line">db.json</span><br><span class="line">*.log</span><br><span class="line">node_modules/</span><br><span class="line">public/</span><br><span class="line">.deploy*/</span><br><span class="line">.deploy_git*/</span><br><span class="line">.idea</span><br><span class="line">themes/butterfly/.git</span><br></pre></td></tr></table></figure>如果不是<code>butterfly</code>主题，记得替换最后一行内容为你自己当前使用的主题。</li><li>然后尝试第一次提交你的目录到远程仓库,依然是在<code>[Blogroot]</code>路径下<kbd>右键</kbd>-&gt;<kbd>Git Bash Here</kbd>，输入：<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">git add . <span class="comment"># 添加文件到本地仓库</span></span><br><span class="line">git commit -m <span class="string">&quot;自定义内容即可&quot;</span> <span class="comment"># 添加文件描述信息</span></span><br><span class="line">git remote add origin git@github.com:username/YourRepositoryName.git <span class="comment">#链接远程仓库地址，创建主分支</span></span><br></pre></td></tr></table></figure></li><li>偶尔会遇到一些与远端内容不一致的问题，一般是因为在创建远程仓库时点选了生成<code>README.md</code>或者<code>license</code>的选项，输入指令：<figure class="highlight avrasm"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta"># 要是提示origin已经存在，那么执行</span></span><br><span class="line">git remote rm origin</span><br><span class="line"><span class="meta"># 然后再重新尝试</span></span><br><span class="line">git remote <span class="keyword">add</span> origin git@github.com:username/YourRepositoryName.git</span><br><span class="line"></span><br><span class="line">git pull origin YourBranchName <span class="meta"># 把远程仓库的新增的内容覆盖到本地仓库</span></span><br><span class="line"></span><br><span class="line">git <span class="keyword">push</span> -u origin YourBranchName -f</span><br><span class="line"><span class="meta"># 把本地仓库的文件推送到远程仓库的主分支，</span></span><br><span class="line"><span class="meta">#YourBranchName记得替换成分支名，一般是master。</span></span><br><span class="line"><span class="meta">#2020年10月后github新建仓库默认分支改为main</span></span><br><span class="line"><span class="meta"># -f 是强制提交，主要是因为前后版本不一致造成的。</span></span><br><span class="line"><span class="meta"># 然后执行以下指令生成网站并部署到 GitHub 上。</span></span><br><span class="line"><span class="meta">#(Hexo部署网站是根据_config.yml内的配置，所以不受影响）</span></span><br><span class="line">hexo generate</span><br><span class="line">hexo deploy</span><br></pre></td></tr></table></figure></li></ol><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div><div class="tab-item-content" id="博客部署-2"><ol><li>创建source分支<div class="note primary flat"><p>首先，我们先在<code>username.github.io</code>仓库里做这些事情。<br>在仓库中新建一个分支，命名为<code>source</code><br><img src="" data-lazy-src="https://s2.ax1x.com/2019/04/10/ATZKcn.png" alt="new branch"></p></div></li><li>然后把source设置为默认分支。<div class="note default flat"><p><img src="" data-lazy-src="https://s2.ax1x.com/2019/04/10/ATZu1s.png" alt="default branch"></p></div></li><li>第一次提交git<div class="note default flat"><p>开始准备你的第一次提交<code>git</code><br>修改博客内容后依次执行以下命令来提交网站相关的文件：</p></div><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git init</span><br></pre></td></tr></table></figure><div class="note warning flat"><p>这句在这里主要是为了在文件夹中<code>git init</code>让<code>git</code>标记此文件夹为版本库<br>如果不写这句，不出意外会报错<code>&quot;fatal: not a git repository (or any of the parent directories): .git&quot;</code><br>和<code>hexo init</code>一样，只要第一次时运行一次就好</p></div></li><li>在<code>[Blogroot]</code>路径下<kbd>右键</kbd>-&gt;<kbd>Git Bash Here</kbd>，输入<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git init <span class="comment"># 初始化git</span></span><br></pre></td></tr></table></figure>这一步会在你的博客目录下新建一个<code>.git</code>文件夹。因为是隐藏文件夹，所以需要你先确保当前目录下隐藏文件夹可见才能看到它。</li><li>在远端提交前，我们需要先调整一下屏蔽项，能够使用指令进行安装的内容不包括在需要提交的源码内，这样可以显著减少需要提交的文件量和加快提交速度。打开<code>[Blogroot]/.gitignore</code>（也是隐藏文件）,输入以下内容：<figure class="highlight txt"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">.DS_Store</span><br><span class="line">Thumbs.db</span><br><span class="line">db.json</span><br><span class="line">*.log</span><br><span class="line">node_modules/</span><br><span class="line">public/</span><br><span class="line">.deploy*/</span><br><span class="line">.deploy_git*/</span><br><span class="line">.idea</span><br><span class="line">themes/butterfly/.git</span><br></pre></td></tr></table></figure>如果不是<code>butterfly</code>主题，记得替换最后一行内容为你自己当前使用的主题。</li><li>然后尝试第一次提交你的目录到远程仓库,依然是在<code>[Blogroot]</code>路径下<kbd>右键</kbd>-&gt;<kbd>Git Bash Here</kbd>，输入：<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 添加文件到本地仓库</span></span><br><span class="line">git add .</span><br><span class="line"><span class="comment"># 添加文件描述信息</span></span><br><span class="line">git commit -m <span class="string">&quot;自定义内容即可&quot;</span></span><br><span class="line"><span class="comment"># 添加远程仓库地址,链接远程仓库，创建主分支</span></span><br><span class="line">git remote add origin git@github.com:username/username.github.io.git</span><br><span class="line"><span class="comment"># 要是提示origin已经存在，那么执行</span></span><br><span class="line">git remote <span class="built_in">rm</span> origin</span><br><span class="line"><span class="comment"># 然后再次尝试</span></span><br><span class="line">git remote add origin git@github.com:username/username.github.io.git</span><br><span class="line"><span class="comment"># 把远程仓库的新增的内容覆盖到本地仓库</span></span><br><span class="line">git pull origin <span class="built_in">source</span></span><br><span class="line"><span class="comment"># 把本地仓库的文件推送到远程仓库</span></span><br><span class="line">git push -u origin <span class="built_in">source</span> -f</span><br><span class="line"><span class="comment"># 强制提交，主要是因为前后版本不一致造成的，</span></span><br><span class="line"><span class="comment"># 然后执行以下任意一条生成网站并部署到 GitHub 上。</span></span><br><span class="line">hexo generate -d</span><br><span class="line">hexo g -d</span><br></pre></td></tr></table></figure><div class="note success flat"><p>这样一来，在 <code>GitHub</code> 上的 <code>username.github.io</code> 仓库就有两个分支，<br>一个 <code>source</code> 分支用来存放网站的原始文件，<br>一个 <code>master</code> 分支用来存放生成的静态网页。(2020年10月后github新建仓库默认分支由master改为main)</p></div></li><li>可能遇到的bug<ul><li>通过<code>git clone</code> 命令下载的<code>themes</code>或者<code>module</code>文件中可能有<code>.git文件夹</code>，会有影响，所以删去，想留着以后方便升级主题也有办法，不过实在太烦，还不如删了痛快，留着教程以后重新配置主题可能还快些。比如我就是在<code>next</code>这个主题文件夹里有个<code>.git</code>文件夹。</li><li>报错<code>Please make sure you have the correct access rights and the repository exists</code><br>这个貌似是因为我们新建了分支的关系，反正它的意思就是找不到你的服务器了，如果上面操作都没问题的话建议你删除在<code>user/username/</code>下的<code>.ssh文件夹</code>，<br>然后重新回到<code>部署git和github</code>再配置一下你的<code>ssh key</code>。</li><li>分支依然是<code>master</code><br>不出意外的话这里你会和我遇到一样的问题，你的分支依然是<code>master</code>，所以要转到<code>source</code>，其实无伤大雅，反正下面提交命令还是提交到<code>source</code><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git checkout -b <span class="built_in">source</span></span><br></pre></td></tr></table></figure></li><li>提示<code>refusing to merge unrelated histories</code><br>意思就是，这两个合并的仓库提交历史不一致，所以拒绝合并。<br>那么添加<code>--allow-unrelated-histories</code>指令表示允许强制合并。<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git pull origin <span class="built_in">source</span> --allow-unrelated-histories</span><br></pre></td></tr></table></figure></li></ul></li></ol><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div></div></div><h3 id="博客管理流程"><a href="#博客管理流程" class="headerlink" title="博客管理流程"></a>博客管理流程</h3><p>在本地对博客进行修改（添加新博文、修改样式等等）后，通过下面的流程进行管理</p><ol><li>依次执行指令<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">git add .</span><br><span class="line">git commit -m <span class="string">&quot;...&quot;</span></span><br><span class="line">git push</span><br><span class="line"><span class="comment"># 将改动推送到 GitHub</span></span><br></pre></td></tr></table></figure></li><li>然后才执行<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">hexo generate -d</span><br><span class="line"><span class="comment"># 或者</span></span><br><span class="line">hexo g -d</span><br></pre></td></tr></table></figure>将本地文件发布网站到<code>master</code>分支上。(2020年10月后github新建仓库默认分支由master改为main)</li></ol><h3 id="本地资料丢失或多PC同步"><a href="#本地资料丢失或多PC同步" class="headerlink" title="本地资料丢失或多PC同步"></a>本地资料丢失或多PC同步</h3><p>当重装电脑之后，或者想在其他电脑上修改博客，可以使用下列步骤：</p><ol><li>使用<code>git clone git@github.com:Username/[HexoSourceRepo].git</code>拷贝仓库；<br>此处的<code>[HexoSourceRepo]</code>指代上述博客源码存放方案中存放源码的仓库名。</li><li>在本地新拷贝的<code>[HexoSourceRepo]</code>文件夹下通过终端依次执行下列指令：<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">npm install -g hexo-cli</span><br><span class="line">npm install</span><br></pre></td></tr></table></figure>在下一篇的<a href="/posts/e5502ef6/">Ubuntu-Hexo+github搭建个人博客</a>中，用这个方法部署文件就会很快。</li></ol><h3 id="指令脚本"><a href="#指令脚本" class="headerlink" title="指令脚本"></a>指令脚本</h3><div class="tabs" id="指令脚本"><ul class="nav-tabs"><li class="tab"><button type="button" data-href="#指令脚本-1">🏅普通版</button></li><li class="tab"><button type="button" data-href="#指令脚本-2">🏆升级版</button></li></ul><div class="tab-contents"><div class="tab-item-content" id="指令脚本-1"><p>每次都要反复敲那么几行指令一定会无聊，那么干脆把指令存在脚本里，每次需要用到的时候双击一下就可以高枕无忧了。<br>在<code>[Blogroot]</code>文件夹下新建三个<code>txt</code>文件，分别命名为<code>git-pull</code>、<code>git-push</code>、<code>hexo-publish</code>,打开后依次在里面输入相应的命令。</p><ul><li>git-pull（用来从远程仓库拉取最新更改，适用于多PC或多系统端之间的版本对接）<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git pull</span><br></pre></td></tr></table></figure></li><li>git-push（用于提交每次的修改到远程仓库）<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">git add .</span><br><span class="line">git commit -m <span class="string">&quot;deploy from hexo-admin&quot;</span></span><br><span class="line">git push</span><br></pre></td></tr></table></figure></li><li>hexo-publish（清空本地缓存后重新部署博客页面）<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">hexo clean</span><br><span class="line">hexo generate</span><br><span class="line">hexo depoly</span><br></pre></td></tr></table></figure>之后将<code>.txt</code>后缀更改为<code>.sh</code>后缀，就是一个可执行脚本了。</li></ul><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div><div class="tab-item-content" id="指令脚本-2"><ol><li>直接下载后放到博客根目录<code>[Blogroot]/</code>路径下。我会将最新的脚本添加到下载目录。建议直接使用下载版。<div class="btns rounded"><a class="button" href="/download/menu.sh" title="下载最新版menu.sh"><i class="fas fa-download"></i> 下载最新版menu.sh</a></div></li><li>在hexo根目录<code>[blogroot]/</code>下新建一个脚本文件：<code>menu.sh</code>,将以下内容复制进去。<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br><span class="line">284</span><br><span class="line">285</span><br><span class="line">286</span><br><span class="line">287</span><br><span class="line">288</span><br><span class="line">289</span><br><span class="line">290</span><br><span class="line">291</span><br><span class="line">292</span><br><span class="line">293</span><br><span class="line">294</span><br><span class="line">295</span><br><span class="line">296</span><br><span class="line">297</span><br><span class="line">298</span><br><span class="line">299</span><br><span class="line">300</span><br><span class="line">301</span><br><span class="line">302</span><br><span class="line">303</span><br><span class="line">304</span><br><span class="line">305</span><br><span class="line">306</span><br><span class="line">307</span><br><span class="line">308</span><br><span class="line">309</span><br><span class="line">310</span><br><span class="line">311</span><br><span class="line">312</span><br><span class="line">313</span><br><span class="line">314</span><br><span class="line">315</span><br><span class="line">316</span><br><span class="line">317</span><br><span class="line">318</span><br><span class="line">319</span><br><span class="line">320</span><br><span class="line">321</span><br><span class="line">322</span><br><span class="line">323</span><br><span class="line">324</span><br><span class="line">325</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/bin/sh</span></span><br><span class="line"><span class="comment">#本脚本用于群友交流，完全开源，可以随意传阅，不过希望保留出处。</span></span><br><span class="line"><span class="comment">#Author：Akilar</span></span><br><span class="line"><span class="comment">#Modify:Hajeekn(SL)</span></span><br><span class="line"><span class="comment">#Updated: 2021-08-09</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">&quot;==================================================&quot;</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">&quot;              欢迎使用Hexo控制脚本!&quot;</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">&quot;                更方便的魔改版本&quot;</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">&quot;==================================================&quot;</span></span><br><span class="line">HexoPath=$(<span class="built_in">cd</span> <span class="string">&quot;<span class="subst">$(dirname <span class="string">&quot;<span class="variable">$0</span>&quot;</span>)</span>&quot;</span>; <span class="built_in">pwd</span>)</span><br><span class="line"><span class="built_in">cd</span> <span class="variable">$&#123;HexoPath&#125;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32m Blog 根目录：&quot;</span><span class="variable">$&#123;HexoPath&#125;</span><span class="string">&quot;\033[0m\n&quot;</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32m [0] \033[0m 退出菜单\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[31m =============以下功能需要在空文件夹内使用========\033[0m\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32m [1] \033[0m 初始化安装Hexo（仅在第一次安装时使用）\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32m [2] \033[0m 从云端恢复Hexo\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[31m =============以下功能需要在Hexo文件夹内使用======\033[0m\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32m [3] \033[0m 开启本地预览\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32m [4] \033[0m 重新编译后开启本地预览\033[33m（修改过_config.yml需使用这个才能看到变化）\033[0m\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32m [5] \033[0m 新建博客文章\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32m [6] \033[0m 新建博客页面\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32m [7] \033[0m 部署页面到博客网站\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32m [8] \033[0m 从Github拉取最新版本\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32m [9] \033[0m 提交本地修改到GitHub\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32m [10] \033[0m 升级Hexo及插件\033[31m（慎用）\033[0m\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32m [11] \033[0m 重新安装依赖\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32m [12] \033[0m 安装butterfly主题\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32m [13] \033[0m 安装volantis主题\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32m [14] \033[0m 安装Hexo-Admin \033[33m(用于管理或撰写Hexo博文，适合初学者使用)\033[0m\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[31m =============以下功能为全局指令==================\033[0m\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32m [15] \033[0m 安装ssh密钥\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32m [16] \033[0m 验证ssh密钥\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32m [17] \033[0m 切换npm源为阿里镜像\033[33m (当使用publish命令时会出现错误,适用于不发布包的人)\033[0m\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32m [18] \033[0m 切换npm源为官方源\033[33m (安装慢,但可以使用所有命令)\033[0m\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32m [19] \033[0m 安装 Git\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32m [20] \033[0m 安装 Node.js\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;请选择需要的功能，默认选择\033[32m [3] \033[0m开启本地预览\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;选择：\n&quot;</span></span><br><span class="line"><span class="built_in">read</span> answer</span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;1&quot;</span> ]; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在初始化,请坐和放宽...\n&quot;</span></span><br><span class="line"><span class="built_in">mkdir</span> Hexo</span><br><span class="line"><span class="built_in">cd</span> Hexo</span><br><span class="line">npm config <span class="built_in">set</span> registry https://registry.npmmirror.com</span><br><span class="line">npm install -g hexo-cli</span><br><span class="line">hexo init</span><br><span class="line">npm install --save</span><br><span class="line">npm install hexo-deployer-git --save</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 请查看您当前的Hexo版本...\n&quot;</span></span><br><span class="line">hexo version</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 安装完成，您可以开始您的Hexo之旅了！\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 请将本脚本文件放入Hexo文件夹以继续使用其他功能！\n&quot;</span></span><br><span class="line"><span class="built_in">sleep</span> 5s</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m \033[33m请将本脚本文件放入Hexo文件夹以继续使用其他功能！\033[0m\n&quot;</span></span><br><span class="line"><span class="built_in">sleep</span> 5s</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m \033[31m请将本脚本文件放入Hexo文件夹以继续使用其他功能！\033[0m\n&quot;</span></span><br><span class="line"><span class="built_in">sleep</span> 5s</span><br><span class="line"><span class="built_in">exit</span> 0</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;2&quot;</span> ]; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 启动拉取器 ...\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;请输入仓库源码地址: &quot;</span></span><br><span class="line"><span class="built_in">read</span> giturl</span><br><span class="line">git <span class="built_in">clone</span> <span class="variable">$&#123;giturl&#125;</span> Hexo</span><br><span class="line"><span class="built_in">cd</span> Hexo</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 恢复Hexo中...\n&quot;</span></span><br><span class="line">npm config <span class="built_in">set</span> registry https://registry.npmmirror.com</span><br><span class="line">npm install -g hexo-cli</span><br><span class="line"><span class="comment"># npm install gulp-cli -g #全局安装gulp，未配置不用开启</span></span><br><span class="line">npm install --save</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 恢复完成，您可以开始您的Hexo之旅了！\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 请将本脚本文件放入Hexo文件夹以继续使用其他功能！\n&quot;</span></span><br><span class="line"><span class="built_in">sleep</span> 5s</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m \033[33m请将本脚本文件放入Hexo文件夹以继续使用其他功能！\033[0m\n&quot;</span></span><br><span class="line"><span class="built_in">sleep</span> 5s</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m \033[31m请将本脚本文件放入Hexo文件夹以继续使用其他功能！\033[0m\n&quot;</span></span><br><span class="line"><span class="built_in">sleep</span> 5s</span><br><span class="line"><span class="built_in">exit</span> 0</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;3&quot;</span> ] || [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;&quot;</span> ]; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在启动本地预览，可以按Ctrl+C退出\n&quot;</span></span><br><span class="line">hexo s</span><br><span class="line"><span class="built_in">exec</span> <span class="variable">$&#123;HexoPath&#125;</span>/menu.sh</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;4&quot;</span> ]; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在清理本地缓存...\n&quot;</span></span><br><span class="line">hexo clean</span><br><span class="line"><span class="comment"># printf &quot;\033[32mINFO \033[0m 正在更新番剧列表...\n&quot;</span></span><br><span class="line"><span class="comment"># hexo bangumi -u #bilibili追番插件，未配置无需开启</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在重新编译静态页面...\n&quot;</span></span><br><span class="line">hexo generate</span><br><span class="line"><span class="comment"># printf &quot;\033[32mINFO \033[0m 正在压缩静态资源...\n&quot;</span></span><br><span class="line"><span class="comment"># gulp #gulp插件，未配置无需开启</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在开启本地预览，可以按Ctrl+C退出\n&quot;</span></span><br><span class="line">hexo server</span><br><span class="line"><span class="built_in">exec</span> <span class="variable">$&#123;HexoPath&#125;</span>/menu.sh</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;5&quot;</span> ] || [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;&quot;</span> ]; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 请输入您想要新建的文章标题\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m \033[33m标题中的各类标点符号和空格，请用短横\&quot;-\&quot;代替！\033[0m\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;您的文章标题：&quot;</span></span><br><span class="line"><span class="built_in">read</span> posttitle</span><br><span class="line">hexo new post <span class="variable">$&#123;posttitle&#125;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 新建完成，正在尝试为您打开文章文件\n&quot;</span></span><br><span class="line">start <span class="variable">$&#123;HexoPath&#125;</span>/source/_posts/<span class="variable">$&#123;posttitle&#125;</span>.md</span><br><span class="line"><span class="built_in">exec</span> <span class="variable">$&#123;HexoPath&#125;</span>/menu.sh</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;6&quot;</span> ] || [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;&quot;</span> ]; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 请输入您想要新建的页面名称\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m \033[33m名称中的各类标点符号和空格，请用短横\&quot;-\&quot;代替！\033[0m\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;您的页面名称：&quot;</span></span><br><span class="line"><span class="built_in">read</span> pagename</span><br><span class="line">hexo new page <span class="variable">$&#123;pagename&#125;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 新建完成，正在尝试为您打开页面文件\n&quot;</span></span><br><span class="line">start <span class="variable">$&#123;HexoPath&#125;</span>/source/<span class="variable">$&#123;pagename&#125;</span>/index.md</span><br><span class="line"><span class="built_in">exec</span> <span class="variable">$&#123;HexoPath&#125;</span>/menu.sh</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;7&quot;</span> ]; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在清理本地缓存...\n&quot;</span></span><br><span class="line">hexo clean</span><br><span class="line"><span class="comment"># printf &quot;\033[32mINFO \033[0m 正在更新番剧列表...\n&quot;</span></span><br><span class="line"><span class="comment"># hexo bangumi -u #bilibili追番插件，未配置无需开启</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在重新编译静态页面...\n&quot;</span></span><br><span class="line">hexo generate</span><br><span class="line"><span class="comment"># printf &quot;\033[32mINFO \033[0m 正在压缩静态资源...\n&quot;</span></span><br><span class="line"><span class="comment"># gulp #gulp插件，未配置无需开启</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在准备将最新修改部署至Hexo...\n&quot;</span></span><br><span class="line">hexo deploy</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 部署完成，您的网站已经是最新版本！\n&quot;</span></span><br><span class="line"><span class="built_in">sleep</span> 1s</span><br><span class="line"><span class="built_in">exec</span> <span class="variable">$&#123;HexoPath&#125;</span>/menu.sh</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;8&quot;</span> ]; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在启动拉取器...\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;请输入分支名: &quot;</span></span><br><span class="line"><span class="built_in">read</span> branch</span><br><span class="line">git pull origin <span class="variable">$branch</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 拉取完毕，您的博客已是最新版本！\n&quot;</span></span><br><span class="line"><span class="built_in">sleep</span> 1s</span><br><span class="line"><span class="built_in">exec</span> <span class="variable">$&#123;HexoPath&#125;</span>/menu.sh</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;9&quot;</span> ]; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在提交最新修改到GitHub...\n&quot;</span></span><br><span class="line">git add .</span><br><span class="line">git commit -m <span class="string">&quot;Update posts content&quot;</span></span><br><span class="line">git push origin <span class="variable">$branch</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 提交完毕，您的修改已上传至Github！\n&quot;</span></span><br><span class="line"><span class="built_in">sleep</span> 1s</span><br><span class="line"><span class="built_in">exec</span> <span class="variable">$&#123;HexoPath&#125;</span>/menu.sh</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;10&quot;</span> ]; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 请先确认当前版本 ...\n&quot;</span></span><br><span class="line">hexo version</span><br><span class="line"><span class="built_in">sleep</span> 3s</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 即将为您全局升级hexo-cli...\n&quot;</span></span><br><span class="line">npm install hexo-cli -g</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m hexo-cli升级完成，请查看当前版本。\n&quot;</span></span><br><span class="line">hexo version</span><br><span class="line"><span class="built_in">sleep</span> 3s</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 即将为您升级npm-check...\n&quot;</span></span><br><span class="line">npm install -g npm-check</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m npm-check升级完成！\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在使用npm-check检查系统是否有可升级插件...\n&quot;</span></span><br><span class="line">npm-check</span><br><span class="line"><span class="built_in">sleep</span> 3s</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 即将为您升级npm-upgrade...\n&quot;</span></span><br><span class="line">npm install -g npm-upgrade</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在使用npm-upgrade升级插件...\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 您可以在接下来的过程中主动选择是否升级插件\n&quot;</span></span><br><span class="line">npm-upgrade</span><br><span class="line"><span class="built_in">sleep</span> 1s</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在为您保存升级结果...\n&quot;</span></span><br><span class="line">npm update -g</span><br><span class="line">npm update --save</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 恭喜您，您的Hexo已经是最新版本\n&quot;</span></span><br><span class="line"><span class="built_in">sleep</span> 2s</span><br><span class="line"><span class="built_in">exec</span> <span class="variable">$&#123;HexoPath&#125;</span>/menu.sh</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;11&quot;</span> ]; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在清空当前依赖环境 ...\n&quot;</span></span><br><span class="line"><span class="built_in">rm</span> node_modules</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在清空当前依赖关系锁定 ...\n&quot;</span></span><br><span class="line"><span class="built_in">rm</span> package-lock.json</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在清空当前依赖关系缓存 ...\n&quot;</span></span><br><span class="line">npm cache clean --force</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在将npm源替换为阿里云镜像 ...\n&quot;</span></span><br><span class="line">npm config <span class="built_in">set</span> registry https://registry.npmmirror.com</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在重新安装当前依赖环境 ...\n&quot;</span></span><br><span class="line">npm install</span><br><span class="line"><span class="built_in">sleep</span> 2s</span><br><span class="line"><span class="built_in">exec</span> <span class="variable">$&#123;HexoPath&#125;</span>/menu.sh</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;12&quot;</span> ]; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在为您下载最新稳定版butterfly主题 ...\n&quot;</span></span><br><span class="line">git <span class="built_in">clone</span> -b master https://gitee.com/iamjerryw/hexo-theme-butterfly.git themes/butterfly</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在为您安装必要依赖！\n&quot;</span></span><br><span class="line">npm install hexo-renderer-pug hexo-renderer-stylus --save</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 安装完成，感谢您对butterfly的支持！\n&quot;</span></span><br><span class="line"><span class="built_in">sleep</span> 1s</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 请在/Hexo/_config.yml中将theme修改为butterfly以激活主题！\n&quot;</span></span><br><span class="line"><span class="built_in">sleep</span> 3s</span><br><span class="line"><span class="built_in">exec</span> <span class="variable">$&#123;HexoPath&#125;</span>/menu.sh</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;13&quot;</span> ]; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在为您下载最新稳定版volantis主题 ...\n&quot;</span></span><br><span class="line">git <span class="built_in">clone</span> https://github.com/volantis-x/hexo-theme-volantis themes/volantis</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在安装本地搜索必要依赖！\n&quot;</span></span><br><span class="line">npm install hexo-generator-search --save</span><br><span class="line">npm install hexo-generator-json-content --save</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在安装页面渲染必要依赖！\n&quot;</span></span><br><span class="line">npm install hexo-renderer-stylus --save</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 安装完成，感谢您对volantis的支持！\n&quot;</span></span><br><span class="line"><span class="built_in">sleep</span> 1s</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 请在/Hexo/_config.yml中将theme修改为volantis以激活主题！\n&quot;</span></span><br><span class="line"><span class="built_in">sleep</span> 3s</span><br><span class="line"><span class="built_in">exec</span> <span class="variable">$&#123;HexoPath&#125;</span>/menu.sh</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;14&quot;</span> ]; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在为您下载Hexo-Admin插件 ...\n&quot;</span></span><br><span class="line">npm install hexo-admin --save</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 安装完成，即将为您启动本地预览！\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 请访问 http://localhost:4000/admin/ 进行博文编辑！\n&quot;</span></span><br><span class="line"><span class="built_in">sleep</span> 2s</span><br><span class="line">hexo server</span><br><span class="line"><span class="built_in">sleep</span> 1s</span><br><span class="line"><span class="built_in">exec</span> <span class="variable">$&#123;HexoPath&#125;</span>/menu.sh</span><br><span class="line"></span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;15&quot;</span> ]; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在启动Git工具...\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;请输入 GitHub 用户名: &quot;</span></span><br><span class="line"><span class="built_in">read</span> githubuser</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;请输入 GitHub 邮箱: &quot;</span></span><br><span class="line"><span class="built_in">read</span> githubemail</span><br><span class="line">git config --global user.name <span class="string">&quot;<span class="variable">$githubuser</span>&quot;</span></span><br><span class="line">git config --global user.email <span class="string">&quot;<span class="variable">$githubemail</span>&quot;</span></span><br><span class="line">ssh-keygen -t rsa -C <span class="variable">$githubemail</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 即将打开sshkey，复制后可按 Ctrl+D 返回...\n&quot;</span></span><br><span class="line"><span class="built_in">sleep</span> 2s</span><br><span class="line">less ~/.ssh/id_rsa.pub</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 配置完成，请将sshkey添加到Github！\n&quot;</span></span><br><span class="line"><span class="built_in">sleep</span> 1s</span><br><span class="line"><span class="built_in">exec</span> <span class="variable">$&#123;HexoPath&#125;</span>/menu.sh</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;16&quot;</span> ]; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在验证SSHkey是否配置成功 ...\n&quot;</span></span><br><span class="line">ssh -T git@github.com</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 验证完毕，您的SSHkey已成功绑定至Github！\n&quot;</span></span><br><span class="line"><span class="built_in">sleep</span> 1s</span><br><span class="line"><span class="built_in">exec</span> <span class="variable">$&#123;HexoPath&#125;</span>/menu.sh</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;17&quot;</span> ]; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在查询当前npm源 ...\n&quot;</span></span><br><span class="line">npm config get registry</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在将npm源替换为阿里云镜像 ...\n&quot;</span></span><br><span class="line">npm config <span class="built_in">set</span> registry https://registry.npmmirror.com</span><br><span class="line"><span class="built_in">sleep</span> 2s</span><br><span class="line"><span class="built_in">exec</span> <span class="variable">$&#123;HexoPath&#125;</span>/menu.sh</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;18&quot;</span> ]; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在查询当前npm源 ...\n&quot;</span></span><br><span class="line">npm config get registry</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 正在将npm源替换为官方源 ...\n&quot;</span></span><br><span class="line">npm config <span class="built_in">set</span> registry https://registry.npmjs.org</span><br><span class="line"><span class="built_in">sleep</span> 2s</span><br><span class="line"><span class="built_in">exec</span> <span class="variable">$&#123;HexoPath&#125;</span>/menu.sh</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;19&quot;</span> ]; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 安装 Git 暂不支持linux、macos,如果你是linux或macos用户,请使用系统自带的包管理器安装 ...\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 启动下载器 ...\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;安装默认使用32包,如果要安装64请更改sh源码或手动将32替换为64 ...\n&quot;</span></span><br><span class="line"><span class="built_in">mkdir</span> temp</span><br><span class="line"><span class="built_in">cd</span> temp</span><br><span class="line">certutil -urlcache -<span class="built_in">split</span> -f https://npmmirror.com/mirrors/git-for-windows/v2.32.0.windows.2/Git-2.32.0.2-32-bit.exe</span><br><span class="line">./Git-2.32.0.2-32-bit.exe</span><br><span class="line"><span class="built_in">rm</span> -r temp</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;安装完成&quot;</span></span><br><span class="line"><span class="built_in">sleep</span> 2s</span><br><span class="line"><span class="built_in">exec</span> <span class="variable">$&#123;HexoPath&#125;</span>/menu.sh</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;20&quot;</span> ]; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 安装 Node.js 暂不支持linux、macos,如果你是linux或macos用户,请使用系统自带的包管理器安装 ...\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 启动下载器 ...\n&quot;</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;安装默认使用32包,如果要安装64请更改sh源码或手动将32替换为64 ...\n&quot;</span></span><br><span class="line"><span class="built_in">mkdir</span> temp</span><br><span class="line"><span class="built_in">cd</span> temp</span><br><span class="line">certutil -urlcache -<span class="built_in">split</span> -f https://npmmirror.com/mirrors/node/latest-v12.x/node-v12.22.3-x86.msi</span><br><span class="line">./node-v12.22.3-x86.msi</span><br><span class="line"><span class="built_in">cd</span> ../</span><br><span class="line"><span class="built_in">rm</span> -r temp</span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;安装完成&quot;</span></span><br><span class="line"><span class="built_in">sleep</span> 2s</span><br><span class="line"><span class="built_in">exec</span> <span class="variable">$&#123;HexoPath&#125;</span>/menu.sh</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">&quot;<span class="variable">$&#123;answer&#125;</span>&quot;</span> = <span class="string">&quot;0&quot;</span> ]; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[32mINFO \033[0m 欢迎下次光临！\n&quot;</span></span><br><span class="line"><span class="built_in">sleep</span> 1s</span><br><span class="line"><span class="built_in">exit</span> 0</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"><span class="built_in">printf</span> <span class="string">&quot;\033[31mERROR \033[0m 输入错误，请返回重新选择...\n&quot;</span></span><br><span class="line"><span class="built_in">sleep</span> 1s</span><br><span class="line"><span class="built_in">exec</span> <span class="variable">$&#123;HexoPath&#125;</span>/menu.sh</span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">fi</span></span><br></pre></td></tr></table></figure>复制后记得按照注释信息修改个人账户和邮箱。<br>界面效果如下：<br><img src="" data-lazy-src="https://npm.elemecdn.com/akilar-candyassets/image/97a817ce.png" alt=""></li></ol><button type="button" class="tab-to-top" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div></div></div></article><div class="post-copyright"><div class="post-copyright__title"><span class="post-copyright-info"><h>Win10:Hexo+github搭建个人博客</h></span></div><div class="post-copyright__type"><span class="post-copyright-info"><a href="https://akilar.top/posts/6ef63e2d/">https://akilar.top/posts/6ef63e2d/</a></span></div><div class="post-copyright-m"><div class="post-copyright-m-info"><div class="post-copyright-a"><h>作者</h><div class="post-copyright-cc-info"><h>Akilar</h></div></div><div class="post-copyright-c"><h>发布于</h><div class="post-copyright-cc-info"><h>2019-04-09</h></div></div><div class="post-copyright-u"><h>更新于</h><div class="post-copyright-cc-info"><h>2021-08-09</h></div></div><div class="post-copyright-c"><h>许可协议</h><div class="post-copyright-cc-info"><a class="icon" rel="noopener external nofollow noreferrer" target="_blank" title="Creative Commons" href="https://creativecommons.org/"><i class="fab fa-creative-commons"></i></a><a rel="noopener external nofollow noreferrer" target="_blank" title="CC BY-NC-SA 4.0" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a></div></div></div></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/%F0%9F%93%81Hexo/">📁Hexo</a><a class="post-meta__tags" href="/tags/%F0%9F%8D%A8Win10/">🍨Win10</a><a class="post-meta__tags" href="/tags/%F0%9F%92%BBgit/">💻git</a></div><div class="post_share"></div></div><link rel="stylesheet" href="https://npm.elemecdn.com/akiblog@1.0.1/css/coin.css" media="defer" onload='this.media="all"'><div class="post-reward"><button class="tip-button reward-button"><span class="tip-button__text">不给糖果就捣蛋</span><div class="coin-wrapper"><div class="coin"><div class="coin__middle"></div><div class="coin__back"></div><div class="coin__front"></div></div></div><div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="https://npm.elemecdn.com/akiblog@1.0.1/img/wechat.png" rel="external nofollow noreferrer" target="_blank"><img class="post-qr-code-img" src="" data-lazy-src="https://npm.elemecdn.com/akiblog@1.0.1/img/wechat.png" alt="wechat"></a><div class="post-qr-code-desc">wechat</div></li><li class="reward-item"><a href="https://npm.elemecdn.com/akiblog@1.0.1/img/alipay.png" rel="external nofollow noreferrer" target="_blank"><img class="post-qr-code-img" src="" data-lazy-src="https://npm.elemecdn.com/akiblog@1.0.1/img/alipay.png" alt="alipay"></a><div class="post-qr-code-desc">alipay</div></li></ul></div></button></div><audio id="coinAudio" src="https://npm.elemecdn.com/akilar-candyassets/audio/aowu.m4a"></audio><script defer src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/coin.js"></script><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="javascript:void(0);" rel="external nofollow noreferrer" onclick="SAONotify(&quot;Prev Post&quot;,&quot;是否跳转至上一篇：&lt;br&gt;Win10重装日记&quot;,&quot;pjax.loadUrl('/posts/29cf4234/')&quot;)" title="Win10重装日记"><i class="fas fa-chevron-left prev-icon"><div class="prev-label">上一篇</div></i></a><div class="pagination-card"><img class="prev-cover" src="" data-lazy-src="https://img.zcool.cn/community/01729c61dd8ce711013f01cd0f12a3.jpg?x-oss-process=image/auto-orient,1/resize,m_lfit,w_1280,limit_1/sharpen,100/format,webp/quality,q_100" onerror='onerror=null,src="https://npm.elemecdn.com/akiblog@1.0.1/img/loading.gif"' alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">Win10重装日记</div></div></div></div><div class="next-post pull-right"><a href="javascript:void(0);" rel="external nofollow noreferrer" onclick="SAONotify(&quot;Next Post&quot;,&quot;是否跳转至下一篇：&lt;br&gt;Ubuntu:Hexo+github搭建个人博客&quot;,&quot;pjax.loadUrl('/posts/e5502ef6/')&quot;)" title="Ubuntu:Hexo+github搭建个人博客"><i class="fas fa-chevron-right next-icon"><div class="next-label">下一篇</div></i></a><div class="pagination-card"><img class="next-cover" src="" data-lazy-src="https://img.zcool.cn/community/01a6b161e1626511013f01cd9953a2.jpg?x-oss-process=image/auto-orient,1/resize,m_lfit,w_1280,limit_1/sharpen,100/format,webp/quality,q_100" onerror='onerror=null,src="https://npm.elemecdn.com/akiblog@1.0.1/img/loading.gif"' alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">Ubuntu:Hexo+github搭建个人博客</div></div></div></div></nav><hr><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i> <span>评论</span></div></div><div class="comment-wrap"><div><div id="twikoo-wrap"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-author"><div class="item-headline"><i class="fa-solid fa-circle-user"></i><span>作者信息</span></div><div class="author-main-content"><div class="author-check-content"><label class="author-info" for="author-info"><input id="author-info" type="checkbox" name="author-info"><div class="author-avatar"><img src="" data-lazy-src="https://npm.elemecdn.com/akiblog@1.0.1/img/author.webp" onerror='this.onerror=null,this.src="https://npm.elemecdn.com/akiblog@1.0.1/img/404.gif"' alt="avatar"></div><div class="author-name">Akilar</div></label></div><div class="author-switch-content"><input class="switch-content" type="radio" name="switch-content" value="description"><label class="author-description-box"><div class="author-description">流水幽吟绕耳边，<br>煦风馨语抚心弦，<br>挥臂欲揽冰钩月，<br>银星斟酌醉人涎。</div></label><input class="switch-content" type="radio" name="switch-content" value="social" checked><label class="author-social-box"><a class="card-author-button" target="_blank" rel="noopener external nofollow noreferrer" href="https://jq.qq.com/?_wv=1027&amp;k=tNuEdliQ"><i class="fa fa-paper-plane faa-tada"></i><span>加入糖果屋群聊</span></a><div class="social-icons"><a class="social-icon faa-parent animated-hover" href="https://github.com/Akilarlxh" rel="external nofollow noreferrer" target="_blank" title="Github"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-identity-01"></use></svg></a><a class="social-icon faa-parent animated-hover" href="mailto:Akilarlxh@gmail.com" rel="external nofollow noreferrer" target="_blank" title="Email"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-Openmail-01"></use></svg></a><a class="social-icon faa-parent animated-hover" href="https://space.bilibili.com/22976782" rel="external nofollow noreferrer" target="_blank" title="Bilibili"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-film-01"></use></svg></a><a class="social-icon faa-parent animated-hover" href="https://music.163.com/#/user/home?id=292643778" rel="external nofollow noreferrer" target="_blank" title="Cloudmusic"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-songlist-01"></use></svg></a><a class="social-icon faa-parent animated-hover" href="/atom.xml" target="_blank" title="RSS"><svg class="icon faa-tada" aria-hidden="true"><use xlink:href="#icon-pushpin-01"></use></svg></a></div></label><input class="switch-content" type="radio" name="switch-content" value="site-data"><label class="author-data-box"><div class="site-data"><a class="data-item" href="/archives/"><div class="data-name">文章</div><div class="data-length">480</div></a><a class="data-item" href="/tags/"><div class="data-name">标签</div><div class="data-length">63</div></a><a class="data-item" href="/categories/"><div class="data-name">分类</div><div class="data-length">6</div></a></div></label></div></div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%86%99%E5%9C%A8%E6%9C%80%E5%89%8D"><span class="toc-number">1.</span> <span class="toc-text">写在最前</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%87%86%E5%A4%87%E5%B7%A5%E4%BD%9C"><span class="toc-number">2.</span> <span class="toc-text">准备工作</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%AE%89%E8%A3%85Hexo"><span class="toc-number">3.</span> <span class="toc-text">安装Hexo</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%83%A8%E7%BD%B2%E5%88%B0GitHub"><span class="toc-number">4.</span> <span class="toc-text">部署到GitHub</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%9F%9F%E5%90%8D%E9%85%8D%E7%BD%AE"><span class="toc-number">5.</span> <span class="toc-text">域名配置</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%BB%E9%A2%98%E9%85%8D%E7%BD%AE"><span class="toc-number">6.</span> <span class="toc-text">主题配置</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%89%88%E6%9C%AC%E6%8E%A7%E5%88%B6"><span class="toc-number">7.</span> <span class="toc-text">版本控制</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%BA%90%E7%A0%81%E5%AD%98%E6%94%BE%E6%96%B9%E6%A1%88%EF%BC%9A%E5%BC%80%E6%BA%90or%E9%97%AD%E6%BA%90"><span class="toc-number">7.1.</span> <span class="toc-text">源码存放方案：开源or闭源</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%8D%9A%E5%AE%A2%E7%AE%A1%E7%90%86%E6%B5%81%E7%A8%8B"><span class="toc-number">7.2.</span> <span class="toc-text">博客管理流程</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%9C%AC%E5%9C%B0%E8%B5%84%E6%96%99%E4%B8%A2%E5%A4%B1%E6%88%96%E5%A4%9APC%E5%90%8C%E6%AD%A5"><span class="toc-number">7.3.</span> <span class="toc-text">本地资料丢失或多PC同步</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%8C%87%E4%BB%A4%E8%84%9A%E6%9C%AC"><span class="toc-number">7.4.</span> <span class="toc-text">指令脚本</span></a></li></ol></li></ol></div></div><div class="card-widget card-recommend-post"><div class="item-headline"><i class="fas fa-dharmachakra"></i><span>相关推荐</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/posts/803c5fab/" title="双系统 Hexo和github的常用命令行归纳"><img src="" data-lazy-src="https://img.zcool.cn/community/014b6b61e1626511013f01cd5157ce.jpg?x-oss-process=image/auto-orient,1/resize,m_lfit,w_1280,limit_1/sharpen,100/format,webp/quality,q_100" alt="双系统 Hexo和github的常用命令行归纳"></a><div class="content"><a class="title" href="/posts/803c5fab/" title="双系统 Hexo和github的常用命令行归纳">双系统 Hexo和github的常用命令行归纳</a><time datetime="2019-04-12" title="发表于 2019-04-12">2019-04-12</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/54c08a4b/" title="只靠Github和Vercel的速度还是有些捉襟见肘，因此再增加一条Coding来为国内访问节点提供线路。"><img src="" data-lazy-src="https://img.zcool.cn/community/01593e61dd8ce411013e8cd0aa8bab.jpg?x-oss-process=image/auto-orient,1/resize,m_lfit,w_1280,limit_1/sharpen,100/format,webp/quality,q_100" alt="只靠Github和Vercel的速度还是有些捉襟见肘，因此再增加一条Coding来为国内访问节点提供线路。"></a><div class="content"><a class="title" href="/posts/54c08a4b/" title="使用Coding和Github来实现双线部署">使用Coding和Github来实现双线部署</a><time datetime="2020-09-21" title="发表于 2020-09-21">2020-09-21</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/f752c86d/" title="通过使用Github Action，将部署的步骤交给云端完成，每次只需Push即可坐等网站部署完毕。"><img src="" data-lazy-src="https://img.zcool.cn/community/0125fe61e57b6111013e8cd04af4a2.jpg?x-oss-process=image/auto-orient,1/resize,m_lfit,w_1280,limit_1/sharpen,100/format,webp/quality,q_100" alt="通过使用Github Action，将部署的步骤交给云端完成，每次只需Push即可坐等网站部署完毕。"></a><div class="content"><a class="title" href="/posts/f752c86d/" title="使用Github Action实现全自动部署">使用Github Action实现全自动部署</a><time datetime="2020-09-22" title="发表于 2020-09-22">2020-09-22</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/812734f8/" title="使用第三方托管服务来加速博客，能够有效改善访问慢的情况。"><img src="" data-lazy-src="https://img.zcool.cn/community/014b6b61e1626511013f01cd5157ce.jpg?x-oss-process=image/auto-orient,1/resize,m_lfit,w_1280,limit_1/sharpen,100/format,webp/quality,q_100" alt="使用第三方托管服务来加速博客，能够有效改善访问慢的情况。"></a><div class="content"><a class="title" href="/posts/812734f8/" title="使用第三方托管平台部署博客">使用第三方托管平台部署博客</a><time datetime="2022-12-06" title="发表于 2022-12-06">2022-12-06</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/e5502ef6/" title="Ubuntu下搭建Hexo+github环境。"><img src="" data-lazy-src="https://img.zcool.cn/community/01a6b161e1626511013f01cd9953a2.jpg?x-oss-process=image/auto-orient,1/resize,m_lfit,w_1280,limit_1/sharpen,100/format,webp/quality,q_100" alt="Ubuntu下搭建Hexo+github环境。"></a><div class="content"><a class="title" href="/posts/e5502ef6/" title="Ubuntu:Hexo+github搭建个人博客">Ubuntu:Hexo+github搭建个人博客</a><time datetime="2019-04-11" title="发表于 2019-04-11">2019-04-11</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/f08df520/" title="重写了一个侧栏作者卡片。搭配侧栏卡片修改一起使用。"><img src="" data-lazy-src="https://img.zcool.cn/community/01a6b161e1626511013f01cd9953a2.jpg?x-oss-process=image/auto-orient,1/resize,m_lfit,w_1280,limit_1/sharpen,100/format,webp/quality,q_100" alt="重写了一个侧栏作者卡片。搭配侧栏卡片修改一起使用。"></a><div class="content"><a class="title" href="/posts/f08df520/" title="源计划-方舟：作者卡片">源计划-方舟：作者卡片</a><time datetime="2022-12-31" title="发表于 2022-12-31">2022-12-31</time></div></div></div></div></div></div></main><footer id="footer"><div id="ark-footer-wraper"><div class="ark-footer-container"><div class="ark-footer-left-corner"><div id="ark-footer-bdage-container"><div class="ark-footer-bdage swiper-wrapper"><a class="ark-bdage-item swiper-slide" href="https://hexo.io/" rel="external nofollow noreferrer" title="博客框架为Hexo_v6.2.0" target="_blank"><svg class="icon ark-decoration" aria-hidden="true"><use xlink:href="#icon-hexo"></use></svg><span>Frame-Hexo</span></a><a class="ark-bdage-item swiper-slide" href="https://butterfly.js.org/" rel="external nofollow noreferrer" title="主题版本Butterfly_v4.4.0" target="_blank"><svg class="icon ark-decoration" aria-hidden="true"><use xlink:href="#icon-Butterfly"></use></svg><span>Theme-Butterfly</span></a><a class="ark-bdage-item swiper-slide" href="https://www.jsdelivr.com/" rel="external nofollow noreferrer" title="本站使用JsDelivr为静态资源提供CDN加速" target="_blank"><svg class="icon ark-decoration" aria-hidden="true"><use xlink:href="#icon-jsdelivr"></use></svg><span>CDN-jsDelivr</span></a><a class="ark-bdage-item swiper-slide" href="https://console.dogecloud.com/" rel="external nofollow noreferrer" title="本网站由多吉云提供CDN加速服务" target="_blank"><svg class="icon ark-decoration" aria-hidden="true"><use xlink:href="#icon-DOGE"></use></svg><span>CDN-dogecloud</span></a><a class="ark-bdage-item swiper-slide" href="https://beian.miit.gov.cn" title="本站已在工信部备案，备案号浙ICP备-2021026687号" target="_blank"><svg class="icon ark-decoration" aria-hidden="true"><use xlink:href="#icon-a-255_icp-license"></use></svg><span>ICP-2021026687-1</span></a><a class="ark-bdage-item swiper-slide" href="https://icp.gov.moe/?keyword=20212887" title="本站已加入萌ICP豪华套餐，萌ICP备20212887号" target="_blank"><svg class="icon ark-decoration" aria-hidden="true"><use xlink:href="#icon-space_demo_equipment"></use></svg><span>moeICP-20212887</span></a><a class="ark-bdage-item swiper-slide" href="https://www.netlify.com/" rel="external nofollow noreferrer" title="本站默认线路托管于Netlify" target="_blank"><svg class="icon ark-decoration" aria-hidden="true"><use xlink:href="#icon-netlify"></use></svg><span>Hosted-Netlify</span></a><a class="ark-bdage-item swiper-slide" href="https://github.com/" rel="external nofollow noreferrer" title="本站项目由Github托管" target="_blank"><svg class="icon ark-decoration" aria-hidden="true"><use xlink:href="#icon-GitHub"></use></svg><span>Source-Github</span></a><a class="ark-bdage-item swiper-slide" href="http://creativecommons.org/licenses/by-nc-sa/4.0/" rel="external nofollow noreferrer" title="本站采用知识共享署名-非商业性使用-相同方式共享4.0国际许可协议进行许可" target="_blank"><svg class="icon ark-decoration" aria-hidden="true"><use xlink:href="#icon-copyright"></use></svg><span>Copyright-BY-NC-SA-4</span></a></div></div><div class="ark-footer-copyright">&copy;2016 - 2023 By Akilar</div><a class="ark-footer-record" target="_blank" rel="noopener" href="https://beian.miit.gov.cn" title="浙ICP备-2021026687号">浙ICP备-2021026687号</a></div><div class="ark-footer-right-corner"><div id="workboard"></div><script async src="/js/custom/runtime.js"></script></div></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open faa-pulse animated-hover"></i><span>阅读模式</span></button><button id="translateLink" type="button" title="简繁转换"><i>繁</i><span>简繁转换</span></button><a class="icon-V hidden" onclick="switchNightMode()" title="昼夜切换"><svg class="faa-pulse animated-hover" width="25" height="25" viewBox="0 0 1024 1024"><use id="modeicon" xlink:href="#icon-moon"></use></svg><span>昼夜切换</span></a><button id="hide-aside-btn" type="button" title="侧栏显隐"><i class="fas fa-arrows-alt-h faa-pulse animated-hover"></i><span>侧栏显隐</span></button><button id="SAO_Utils_Switch" type="button" title="右键开关" onclick="panelAudio(),SAOSwitch()"><i class="fas fa-mouse faa-pulse animated-hover"></i><span>右键开关</span></button><button id="SAO_Utils_Refresh" type="button" title="点击刷新" onclick="panelAudio(),fetchCommits()"><i class="fa-solid fa-arrows-rotate faa-pulse animated-hover"></i><span>点击刷新</span></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin faa-pulse animated-hover"></i><span>设置</span></button><button id="ranklist_show" type="button" title="打赏榜单" onclick="panelAudio(),RanklistBtn()"><i class="fas fa-fire-alt faa-pulse animated-hover"></i><span>打赏榜单</span></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul faa-pulse animated-hover"></i><span>目录</span></button><button id="chat_btn" type="button" title="与我联系"><i class="fas fa-sms faa-pulse animated-hover"></i><span>与我联系</span></button><button id="to_comment" type="button" title="直达评论" onclick="FixedCommentBtn()"><i class="fas fa-comments faa-pulse animated-hover"></i><span>直达评论</span></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up faa-pulse animated-hover"></i><span>回到顶部</span></button></div></div><div id="algolia-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="search-wrap"><div id="algolia-search-input"></div><hr><div id="algolia-search-results"><div id="algolia-hits"></div><div id="algolia-pagination"></div><div id="algolia-info"><div class="algolia-stats"></div><div class="algolia-poweredBy"></div></div></div></div></div><div id="search-mask"></div></div><div><script async src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/async.js"></script><script src="https://npm.elemecdn.com/akiblog@1.0.1/js/utils.js"></script><script src="https://npm.elemecdn.com/akiblog@1.0.1/js/main.js"></script><script defer src="https://npm.elemecdn.com/swiper@8.4.2/swiper-bundle.min.js"></script><script defer data-pjax src="/js/custom/swiper_init.js"></script><script src="https://npm.elemecdn.com/akiblog@1.0.1/js/tw_cn.js"></script><script src="https://npm.elemecdn.com/medium-zoom@1.0.6/dist/medium-zoom.min.js"></script><script src="https://npm.elemecdn.com/instant.page@5.1.1/instantpage.js" type="module"></script><script src="https://npm.elemecdn.com/vanilla-lazyload@17.3.1/dist/lazyload.iife.min.js"></script><script src="https://npm.elemecdn.com/node-snackbar@0.1.16/dist/snackbar.min.js"></script><script src="https://npm.elemecdn.com/algoliasearch@4.14.2/dist/algoliasearch-lite.umd.js"></script><script src="https://npm.elemecdn.com/instantsearch.js@4.44.0/dist/instantsearch.production.min.js"></script><script src="https://npm.elemecdn.com/akiblog@1.0.1/js/search/algolia.js"></script><div class="pjax-reload"><script async>var preloader={endLoading:()=>{if(document.body.style.overflow="auto",document.getElementById("loading-box").style.transition="opacity 3s",document.getElementById("loading-box").style.opacity="0",setTimeout((function(){document.getElementById("loading-box").classList.add("loaded")}),3e3),sessionStorage.getItem("isReload"))return!0;sessionStorage.setItem("isReload",!0),SAONotify("Welcome","欢迎光临糖果屋<br>愿你享受愉快的一天")},initLoading:()=>{document.body.style.overflow="",document.getElementById("loading-box").style.transition="",document.getElementById("loading-box").style.opacity="1",document.getElementById("loading-box").classList.remove("loaded")}};window.addEventListener("load",()=>{preloader.endLoading()}),document.getElementById("loading-box").addEventListener("click",()=>{preloader.endLoading()}),setTimeout((function(){preloader.endLoading()}),3e3)</script></div><div class="js-pjax"><script>(()=>{const t=()=>{twikoo.init(Object.assign({el:"#twikoo-wrap",envId:"https://twikoo-service.akilar.top",region:"",onCommentLoaded:function(){btf.loadLightbox(document.querySelectorAll("#twikoo .tk-content img:not(.tk-owo-emotion)"))}},null))},o=()=>{"object"!=typeof twikoo?getScript("https://npm.elemecdn.com/twikoo@1.6.5/dist/twikoo.all.min.js").then(t):setTimeout(t,0)};btf.loadComment(document.getElementById("twikoo-wrap"),o)})()</script></div><script>window.addEventListener("load",()=>{const e=e=>{let t="";if(e.length)for(let n=0;n<e.length;n++){t+="<div class='aside-list-item'>";{const a="data-lazy-src";t+=`<a href='${e[n].url}' class='thumbnail'><img ${a}='${e[n].avatar}' alt='${e[n].nick}'></a>`}t+=`<div class='content'>\n        <a class='comment' href='${e[n].url}' title='${e[n].content}'>${e[n].content}</a>\n        <div class='name'><span>${e[n].nick} / </span><time datetime="${e[n].date}">${btf.diffDate(e[n].date,!0)}</time></div>\n        </div></div>`}else t+="没有评论";let n=document.querySelector("#card-newest-comments .aside-list");n.innerHTML=t,window.lazyLoadInstance&&window.lazyLoadInstance.update(),window.pjax&&window.pjax.refresh(n)},t=()=>{if(document.querySelector("#card-newest-comments .aside-list")){const t=saveToLocal.get("twikoo-newest-comments");t?e(JSON.parse(t)):(()=>{const t=()=>{twikoo.getRecentComments({envId:"https://twikoo-service.akilar.top",region:"",pageSize:5,includeReply:!0}).then((function(t){const n=t.map(e=>{return{content:(t=e.comment,""===t||(t=(t=(t=(t=t.replace(/<img.*?src="(.*?)"?[^\>]+>/gi,"[图片]")).replace(/<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi,"[链接]")).replace(/<pre><code>.*?<\/pre>/gi,"[代码]")).replace(/<[^>]+>/g,"")).length>150&&(t=t.substring(0,150)+"..."),t),avatar:e.avatar,nick:e.nick,url:e.url+"#"+e.id,date:new Date(e.created).toISOString()};var t});saveToLocal.set("twikoo-newest-comments",JSON.stringify(n),10/1440),e(n)})).catch((function(e){document.querySelector("#card-newest-comments .aside-list").innerHTML="无法获取评论，请确认相关配置是否正确"}))};"object"==typeof twikoo?t():getScript("https://npm.elemecdn.com/twikoo@1.6.5/dist/twikoo.all.min.js").then(t)})()}};t(),document.addEventListener("pjax:complete",t)})</script><script src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/sun_moon.js" async></script><script async data-pjax src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/SAO-NAV.js"></script><script>WIDGET={CONFIG:{modules:"012",background:"5",tmpColor:"FFFFFF",tmpSize:"16",cityColor:"FFFFFF",citySize:"16",aqiColor:"FFFFFF",aqiSize:"16",weatherIconSize:"24",alertIconSize:"18",padding:"10px 10px 10px 10px",shadow:"0",language:"auto",fixed:"false",vertical:"top",horizontal:"left",key:"3da94e567f5e4e88baf90f066f0893c2"}}</script><script defer data-pjax src="https://widget.heweather.net/simple/static/js/he-simple.js?v=1.4.0"></script><script async src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/random.js"></script><script defer src="https://at.alicdn.com/t/c/font_3344355_e443xsjcmum.js"></script><script src="//code.tidio.co/wgamdwbirypo8casl6rjgtfbs47ny3s7.js" async></script><script>function onTidioChatApiReady(){window.tidioChatApi.hide(),window.tidioChatApi.on("close",(function(){window.tidioChatApi.hide()}))}window.tidioChatApi?window.tidioChatApi.on("ready",onTidioChatApiReady):document.addEventListener("tidioChat-ready",onTidioChatApiReady);var chatBtnFn=()=>{document.getElementById("chat_btn").addEventListener("click",(function(){window.tidioChatApi.show(),window.tidioChatApi.open()}))};chatBtnFn()</script><script src="https://npm.elemecdn.com/pjax@0.2.8/pjax.min.js"></script><script>let pjaxSelectors=["head > title","#config-diff","#body-wrap","#rightside-config-hide","#rightside-config-show",".js-pjax","#web_bg","#fixedcard-dashboard"];var pjax=new Pjax({elements:'a:not([target="_blank"])',selectors:pjaxSelectors,cacheBust:!1,analytics:!1,scrollRestoration:!1});document.addEventListener("pjax:send",(function(){if(window.tocScrollFn&&window.removeEventListener("scroll",window.tocScrollFn),window.scrollCollect&&window.removeEventListener("scroll",scrollCollect),"object"==typeof preloader&&preloader.initLoading(),document.getElementById("rightside").style.cssText="opacity: ''; transform: ''",window.aplayers)for(let e=0;e<window.aplayers.length;e++)window.aplayers[e].options.fixed||window.aplayers[e].destroy();"object"==typeof typed&&typed.destroy();const e=document.body.classList;e.contains("read-mode")&&e.remove("read-mode"),"object"==typeof disqusjs&&disqusjs.destroy()})),document.addEventListener("pjax:complete",(function(){window.refreshFn(),document.querySelectorAll("script[data-pjax], .pjax-reload script").forEach(e=>{const t=document.createElement("script"),o=e.text||e.textContent||e.innerHTML||"";Array.from(e.attributes).forEach(e=>t.setAttribute(e.name,e.value)),t.appendChild(document.createTextNode(o)),e.parentNode.replaceChild(t,e)}),GLOBAL_CONFIG.islazyload&&window.lazyLoadInstance.update(),"function"==typeof chatBtnFn&&chatBtnFn(),"function"==typeof panguInit&&panguInit(),"function"==typeof gtag&&gtag("config","",{page_path:window.location.pathname}),"object"==typeof _hmt&&_hmt.push(["_trackPageview",window.location.pathname]),"function"==typeof loadMeting&&document.getElementsByClassName("aplayer").length&&loadMeting(),"object"==typeof Prism&&Prism.highlightAll(),"object"==typeof preloader&&preloader.endLoading()})),document.addEventListener("pjax:error",e=>{404===e.request.status&&pjax.loadUrl("/404.html")})</script><script>"serviceWorker"in navigator&&(navigator.serviceWorker.controller&&navigator.serviceWorker.addEventListener("controllerchange",(function(){fetch("/json/commits.json").then(e=>e.json().then(e=>{for(var r=e,o=0;o<r.length;o++){r[o];var t=o+1+"."+r[o].commit.message;if(o<1)var n=t;else n=n+"<br>"+t}SAONotify("Latest Update",n,"location.reload(true);")})).catch(console.error)})),window.addEventListener("load",(function(){navigator.serviceWorker.register("/sw.js")})))</script><div id="SAO-back"><div id="SAO-menu"><div id="SAO-menu-content"><div class="utils-list"><div class="utils-list-item"><div class="user-panel" style="top:undefined"><div class="user-panel-name">Friends</div><div class="user-panel-img"><img src="" data-lazy-src="/img/info.png"></div><div class="user-panel-properties">Welcome to Akilar の Candyhome !</div></div><i class="fas fa-address-book" onclick="panelAudio(),UtilsClick()"></i><div class="menu-list" style="top:-83px"><div class="menu-list-item"><i class="fa fa-link" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("/link/")}),500)'>Link</i></div><div class="menu-list-item"><i class="fas fa-fire-alt" onclick="clickAudio(),setTimeout((function(){SAOclose(),RanklistBtn()}),500)">Pantner</i></div></div></div><div class="utils-list-item"><div class="user-panel" style="top:undefined"><div class="user-panel-name">Help</div><div class="user-panel-img"><img src="" data-lazy-src="/img/info.png"></div><div class="user-panel-properties"><h4>Anything can I help you ?</h4><p>Tidio：开启在线聊天窗<br>Comment：直达评论区或留言板<br>Candyhome：加入糖果屋QQ群</p></div></div><i class="fa fa-question-circle" onclick="panelAudio(),UtilsClick()"></i><div class="menu-list" style="top:-103px"><div class="menu-list-item"><i class="fa fa-comment-dots" onclick="clickAudio(),setTimeout((function(){SAOclose(),openTidio()}),500)">Tidio</i></div><div class="menu-list-item"><i class="fa fa-comments" onclick="clickAudio(),setTimeout((function(){SAOclose(),FixedCommentBtn()}),500)">Comments</i></div><div class="menu-list-item"><i class="fa fa-user-friends" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("https://jq.qq.com/?_wv=1027&amp;k=a08BZRzs")}),500)'>Candyhome</i></div></div></div><div class="utils-list-item"><div class="user-panel" style="top:undefined"><div class="user-panel-name">Menu</div><div class="user-panel-img"><img src="" data-lazy-src="/img/info.png"></div><div class="user-panel-properties">The menu of my blog</div></div><i class="fa fa-tasks" onclick="panelAudio(),UtilsClick()"></i><div class="menu-list" style="top:-163px"><div class="menu-list-item"><i class="fa fa-home" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("https://blog.akilar.top/")}),500)'>Home</i></div><div class="menu-list-item"><i class="fa fa-folder-open" onclick="panelAudio(),MenusClick()">Document</i><div class="menu-child" style="top:-100px"><div class="menu-list-child"><i class="fa fa-file-invoice" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("/posts/f99b208/")}),500)'>Beautify</i></div><div class="menu-list-child"><i class="fa fa-file-invoice" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("/posts/7c16c4bb/")}),500)'>Optimize</i></div><div class="menu-list-child"><i class="fa fa-file-invoice" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("/posts/615e2dec/")}),500)'>Tag_Plugins</i></div><div class="menu-list-child"><i class="fa fa-file-invoice" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("/posts/6ef63e2d/")}),500)'>Construct</i></div></div></div><div class="menu-list-item"><i class="fa fa-blog" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("/")}),500)'>Blog</i></div><div class="menu-list-item"><i class="fa fa-archive" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("/archives/")}),500)'>Archives</i></div><div class="menu-list-item"><i class="fa fa-folder-open" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("/categories/")}),500)'>Categoties</i></div><div class="menu-list-item"><i class="fa fa-tags" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("/tags/")}),500)'>Tags</i></div></div></div><div class="utils-list-item"><div class="user-panel" style="top:undefined"><div class="user-panel-name">Options</div><div class="user-panel-img"><img src="" data-lazy-src="/img/info.png"></div><div class="user-panel-properties"><h4>Some userful scripts</h4><p>Random： 随机跳转站内文章<br>Search： 打开搜索窗口</p>Refresh： 刷新缓存</div></div><i class="fa fa-tools" onclick="panelAudio(),UtilsClick()"></i><div class="menu-list" style="top:-103px"><div class="menu-list-item"><i class="fa fa-random" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("/toRandomPost()")}),500)'>Random</i></div><div class="menu-list-item"><i class="fa fa-search" onclick="clickAudio(),setTimeout((function(){SAOclose(),openSearch()}),500)">Search</i></div><div class="menu-list-item"><i class="fa-solid fa-arrows-rotate" onclick='clickAudio(),setTimeout((function(){SAOclose(),SAONotify("Refresh","即将为您刷新页面缓存","location.reload(true);")}),500)'>Refresh</i></div></div></div><div class="utils-list-item"><div class="user-panel"><div class="user-panel-name">Instructions</div><div class="user-panel-img"><img src="" data-lazy-src="/img/siteicon/favicon.png"></div><div class="user-panel-properties"><h4>欢迎使用SAO_Utils_Web 2.0</h4><p>点按选项可以持续显示下级菜单。您可以通过按住<kbd>ctrl</kbd>+<kbd>右键</kbd>来恢复使用原生右键菜单，更多内容可点击右侧Option按钮访问教程或Help按钮加入糖果屋QQ群。</p><center>©Akilarの糖果屋</center></div></div><i class="fa fa-cog" onclick="panelAudio(),UtilsClick()"></i><div class="menu-list" style="top:-103px"><div class="menu-list-item"><i class="fa fa-tools" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("https://akilar.top/posts/fd243d7/")}),500)'>Option</i></div><div class="menu-list-item"><i class="fa fa-question-circle" onclick='clickAudio(),setTimeout((function(){SAOclose(),linkStart("https://jq.qq.com/?_wv=1027&amp;k=a08BZRzs")}),500)'>Help</i></div><div class="menu-list-item"><i class="fa fa-sign-out-alt" onclick="alertAudio(),openLogout()">Logout</i></div></div></div><div class="utils-list-item"><i class="fa fa-power-off" onclick="alertAudio(),SAOKeepOff()" title="永久关闭SAO右键菜单"></i></div></div></div></div></div><div id="SAO-logout"><div class="logout-title">Alert</div><div class="logout-alert">是否确认退出?</div><div class="logout-button"><span class="logout-confirm"><button class="far fa-circle" type="button" name="confirm" onclick="clickAudio(),confirmLogout()"></button></span><span class="logout-cancel"><button class="fa fa-times" type="button" name="cancel" onclick="panelAudio(),cancelLogout()"></button></span></div></div><audio id="SAOlauncher" src="https://npm.elemecdn.com/akilar-candyassets/audio/Launcher.mp3"></audio><audio id="SAOClick" src="https://npm.elemecdn.com/akilar-candyassets/audio/Click.mp3"></audio><audio id="SAOPanel" src="https://npm.elemecdn.com/akilar-candyassets/audio/Panel.mp3"></audio><audio id="SAOAlert" src="https://npm.elemecdn.com/akilar-candyassets/audio/Alert.mp3"></audio><script async src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/SAO_Menu.js"></script><div id="SAO-ranklist"><div class="ranklist-title">Rank list</div><div class="ranklist-main"><div class="master-item"><div class="master-rank"><i class="fa fa-plus" onclick="panelAudio(),RanklistBtn()"></i></div><div class="master-user"><a alt="" href="/">Akilar<div class="rank-reward"><div class="reward-img"><img alt="" src="" data-lazy-src="https://npm.elemecdn.com/akiblog@1.0.1/img/wechat.png"><a class="reward-text" alt="" href="/null">wechat</a></div><div class="reward-img"><img alt="" src="" data-lazy-src="https://npm.elemecdn.com/akiblog@1.0.1/img/alipay.png"><a class="reward-text" alt="" href="/null">alipay</a></div></div></a></div><div class="master-data"><div class="master-HP"><div class="HP-fill" style="width:20%"><div class="HP-fill-in"><span>20%</span></div></div></div></div><div class="master-level"><span>270</span><span>|</span><span>1350</span><span>lv.23</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢*蓓打赏的￥180">*蓓</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:100%"><div class="HP-fill-in"><span>100.00%</span></div></div></div></div><div class="partner-level"><span>9200</span><span>|</span><span>9200</span><span>lv.180</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢晨打赏的￥8.88">晨</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:88.86%"><div class="HP-fill-in"><span>88.86%</span></div></div></div></div><div class="partner-level"><span>622</span><span>|</span><span>700</span><span>lv.10</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://zfe.space/" data-title="感谢**鄂打赏的￥9.9">**鄂</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:13.76%"><div class="HP-fill-in"><span>13.76%</span></div></div></div></div><div class="partner-level"><span>523</span><span>|</span><span>3800</span><span>lv.72</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢*光打赏的￥50">*光</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:92.59%"><div class="HP-fill-in"><span>92.59%</span></div></div></div></div><div class="partner-level"><span>2685</span><span>|</span><span>2900</span><span>lv.54</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢*洁打赏的￥30">*洁</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:93.78%"><div class="HP-fill-in"><span>93.78%</span></div></div></div></div><div class="partner-level"><span>1688</span><span>|</span><span>1800</span><span>lv.32</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢**焘打赏的￥20">**焘</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:90.92%"><div class="HP-fill-in"><span>90.92%</span></div></div></div></div><div class="partner-level"><span>1182</span><span>|</span><span>1300</span><span>lv.22</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://szsyzx.github.io/" data-title="感谢懒蟲打赏的￥20">懒蟲</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:74.06%"><div class="HP-fill-in"><span>74.06%</span></div></div></div></div><div class="partner-level"><span>1148</span><span>|</span><span>1550</span><span>lv.27</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢*i打赏的￥10">*i</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:83.38%"><div class="HP-fill-in"><span>83.38%</span></div></div></div></div><div class="partner-level"><span>667</span><span>|</span><span>800</span><span>lv.12</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://www.acozycotage.net/" data-title="感谢acozycotage打赏的￥10">acozycotage</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:NaN%"><div class="HP-fill-in"><span>NaN%</span></div></div></div></div><div class="partner-level"><span>NaN</span><span>|</span><span>NaN</span><span>lv.undefined</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢*因打赏的￥10">*因</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:62.5%"><div class="HP-fill-in"><span>62.50%</span></div></div></div></div><div class="partner-level"><span>625</span><span>|</span><span>1000</span><span>lv.16</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢H*g打赏的￥10">H*g</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:83.38%"><div class="HP-fill-in"><span>83.38%</span></div></div></div></div><div class="partner-level"><span>667</span><span>|</span><span>800</span><span>lv.12</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢**宁打赏的￥10">**宁</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:45.46%"><div class="HP-fill-in"><span>45.46%</span></div></div></div></div><div class="partner-level"><span>591</span><span>|</span><span>1300</span><span>lv.22</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://www.nesxc.com/" data-title="感谢Nesxc打赏的￥14.88">Nesxc</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:74.42%"><div class="HP-fill-in"><span>74.42%</span></div></div></div></div><div class="partner-level"><span>893</span><span>|</span><span>1200</span><span>lv.20</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢J*y打赏的￥2.56">J*y</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:51.11%"><div class="HP-fill-in"><span>51.11%</span></div></div></div></div><div class="partner-level"><span>230</span><span>|</span><span>450</span><span>lv.5</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://www.lbihua.cn" data-title="感谢哔哗打赏的￥10">哔哗</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:62.5%"><div class="HP-fill-in"><span>62.50%</span></div></div></div></div><div class="partner-level"><span>625</span><span>|</span><span>1000</span><span>lv.16</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://iori-yimaga.top" data-title="感谢T*0打赏的￥23.3">T*0</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:93.17%"><div class="HP-fill-in"><span>93.17%</span></div></div></div></div><div class="partner-level"><span>1351</span><span>|</span><span>1450</span><span>lv.25</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢**飞打赏的￥20">**飞</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:74.06%"><div class="HP-fill-in"><span>74.06%</span></div></div></div></div><div class="partner-level"><span>1148</span><span>|</span><span>1550</span><span>lv.27</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢**豪打赏的￥10">**豪</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:83.38%"><div class="HP-fill-in"><span>83.38%</span></div></div></div></div><div class="partner-level"><span>667</span><span>|</span><span>800</span><span>lv.12</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://www.keyiqingxin.cn" data-title="感谢清心打赏的￥3.88">清心</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:19.42%"><div class="HP-fill-in"><span>19.42%</span></div></div></div></div><div class="partner-level"><span>233</span><span>|</span><span>1200</span><span>lv.20</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢鹿栖打赏的￥20">鹿栖</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:74.06%"><div class="HP-fill-in"><span>74.06%</span></div></div></div></div><div class="partner-level"><span>1148</span><span>|</span><span>1550</span><span>lv.27</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://menglei.xyz" data-title="感谢*夢打赏的￥3">*夢</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:27.33%"><div class="HP-fill-in"><span>27.33%</span></div></div></div></div><div class="partner-level"><span>205</span><span>|</span><span>750</span><span>lv.11</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://www.ijinse.cn" data-title="感谢锦瑟打赏的￥50">锦瑟</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:69.45%"><div class="HP-fill-in"><span>69.45%</span></div></div></div></div><div class="partner-level"><span>2639</span><span>|</span><span>3800</span><span>lv.72</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://glann.vip" data-title="感谢glann打赏的￥5.01">glann</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:41.75%"><div class="HP-fill-in"><span>41.75%</span></div></div></div></div><div class="partner-level"><span>334</span><span>|</span><span>800</span><span>lv.12</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢**忠打赏的￥4.48">**忠</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:89.56%"><div class="HP-fill-in"><span>89.56%</span></div></div></div></div><div class="partner-level"><span>403</span><span>|</span><span>450</span><span>lv.5</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://huran.xyz" data-title="感谢忽然打赏的￥13.14">忽然</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:87.58%"><div class="HP-fill-in"><span>87.58%</span></div></div></div></div><div class="partner-level"><span>832</span><span>|</span><span>950</span><span>lv.15</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢XueZha打赏的￥6.66">XueZha</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:66.57%"><div class="HP-fill-in"><span>66.57%</span></div></div></div></div><div class="partner-level"><span>466</span><span>|</span><span>700</span><span>lv.10</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢*葵打赏的￥6.66">*葵</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:66.57%"><div class="HP-fill-in"><span>66.57%</span></div></div></div></div><div class="partner-level"><span>466</span><span>|</span><span>700</span><span>lv.10</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://tianli-blog.club" data-title="感谢天利打赏的￥40.34">天利</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:77.57%"><div class="HP-fill-in"><span>77.57%</span></div></div></div></div><div class="partner-level"><span>2172</span><span>|</span><span>2800</span><span>lv.52</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://bingmeng158.github.io" data-title="感谢冰梦打赏的￥1.5">冰梦</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:30%"><div class="HP-fill-in"><span>30.00%</span></div></div></div></div><div class="partner-level"><span>135</span><span>|</span><span>450</span><span>lv.5</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://0410wzn.top" data-title="感谢WZN打赏的￥1.35">WZN</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:27.11%"><div class="HP-fill-in"><span>27.11%</span></div></div></div></div><div class="partner-level"><span>122</span><span>|</span><span>450</span><span>lv.5</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢KD打赏的￥1.5">KD</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:30%"><div class="HP-fill-in"><span>30.00%</span></div></div></div></div><div class="partner-level"><span>135</span><span>|</span><span>450</span><span>lv.5</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢**庆打赏的￥3.5">**庆</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:70%"><div class="HP-fill-in"><span>70.00%</span></div></div></div></div><div class="partner-level"><span>315</span><span>|</span><span>450</span><span>lv.5</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://www.sunguoqi.com" data-title="感谢小孙打赏的￥5.2">小孙</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:52%"><div class="HP-fill-in"><span>52.00%</span></div></div></div></div><div class="partner-level"><span>364</span><span>|</span><span>700</span><span>lv.10</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://blog.nalex.top" data-title="感谢rootlex打赏的￥4">rootlex</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:80%"><div class="HP-fill-in"><span>80.00%</span></div></div></div></div><div class="partner-level"><span>360</span><span>|</span><span>450</span><span>lv.5</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://dreamfall.cn" data-title="感谢梦落打赏的￥1.88">梦落</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:37.56%"><div class="HP-fill-in"><span>37.56%</span></div></div></div></div><div class="partner-level"><span>169</span><span>|</span><span>450</span><span>lv.5</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://blog.cyfan.top" data-title="感谢CYF打赏的￥1.5">CYF</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:30%"><div class="HP-fill-in"><span>30.00%</span></div></div></div></div><div class="partner-level"><span>135</span><span>|</span><span>450</span><span>lv.5</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢一悲打赏的￥2.5">一悲</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:41.6%"><div class="HP-fill-in"><span>41.60%</span></div></div></div></div><div class="partner-level"><span>208</span><span>|</span><span>500</span><span>lv.6</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://hexo.cf" data-title="感谢八神打赏的￥10">八神</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:83.38%"><div class="HP-fill-in"><span>83.38%</span></div></div></div></div><div class="partner-level"><span>667</span><span>|</span><span>800</span><span>lv.12</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://noionion.top" data-title="感谢贰猹打赏的￥20">贰猹</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:90.92%"><div class="HP-fill-in"><span>90.92%</span></div></div></div></div><div class="partner-level"><span>1182</span><span>|</span><span>1300</span><span>lv.22</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://blog.slqwq.cn" data-title="感谢Hajeekn打赏的￥10">Hajeekn</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:66.63%"><div class="HP-fill-in"><span>66.63%</span></div></div></div></div><div class="partner-level"><span>633</span><span>|</span><span>950</span><span>lv.15</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" target="_blank" rel="noopener external nofollow noreferrer" href="https://baokan0.com" data-title="感谢baokan0打赏的￥20">baokan0</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:95.2%"><div class="HP-fill-in"><span>95.20%</span></div></div></div></div><div class="partner-level"><span>1190</span><span>|</span><span>1250</span><span>lv.21</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢h*d打赏的￥10">h*d</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:66.63%"><div class="HP-fill-in"><span>66.63%</span></div></div></div></div><div class="partner-level"><span>633</span><span>|</span><span>950</span><span>lv.15</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢**航打赏的￥10">**航</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:66.63%"><div class="HP-fill-in"><span>66.63%</span></div></div></div></div><div class="partner-level"><span>633</span><span>|</span><span>950</span><span>lv.15</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢I*u打赏的￥2">I*u</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:40%"><div class="HP-fill-in"><span>40.00%</span></div></div></div></div><div class="partner-level"><span>180</span><span>|</span><span>450</span><span>lv.5</span></div></div><div class="partner-item"><div class="partner-rank"></div><div class="partner-user"><a alt="" href="javascript:void(0);" rel="external nofollow noreferrer" data-title="感谢7*i打赏的￥1">7*i</a></div><div class="partner-data"><div class="partner-HP"><div class="HP-fill" style="width:20%"><div class="HP-fill-in"><span>20.00%</span></div></div></div></div><div class="partner-level"><span>90</span><span>|</span><span>450</span><span>lv.5</span></div></div></div></div><script async src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/SAO_ranklist.js"></script><div class="pjax-reload"><script async>for(var arr=document.getElementsByClassName("recent-post-item"),i=0;i<arr.length;i++)arr[i].classList.add("wow"),arr[i].classList.add("animate__zoomIn"),arr[i].setAttribute("data-wow-duration",""),arr[i].setAttribute("data-wow-delay",""),arr[i].setAttribute("data-wow-offset",""),arr[i].setAttribute("data-wow-iteration","")</script><script async>for(var arr=document.getElementsByClassName("card-widget"),i=0;i<arr.length;i++)arr[i].classList.add("wow"),arr[i].classList.add("animate__zoomIn"),arr[i].setAttribute("data-wow-duration",""),arr[i].setAttribute("data-wow-delay",""),arr[i].setAttribute("data-wow-offset",""),arr[i].setAttribute("data-wow-iteration","")</script><script async>for(var arr=document.getElementsByClassName("article-sort-item"),i=0;i<arr.length;i++)arr[i].classList.add("wow"),arr[i].classList.add("animate__zoomIn"),arr[i].setAttribute("data-wow-duration",""),arr[i].setAttribute("data-wow-delay",""),arr[i].setAttribute("data-wow-offset",""),arr[i].setAttribute("data-wow-iteration","")</script><script async>for(var arr=document.getElementsByClassName("flink-list-card"),i=0;i<arr.length;i++)arr[i].classList.add("wow"),arr[i].classList.add("animate__flipInY"),arr[i].setAttribute("data-wow-duration","1s"),arr[i].setAttribute("data-wow-delay",""),arr[i].setAttribute("data-wow-offset",""),arr[i].setAttribute("data-wow-iteration","")</script></div><script defer src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/wow.min.js"></script><script defer src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/wow_init.js"></script><div id="fixedcard-dashboard"><button class="fixedcard-activebtn" type="button" title="用户信息" onclick="FixedCardWidget(&quot;class&quot;,&quot;card-author&quot;,&quot;0&quot;)"><i class="fas fa-address-book"></i></button><button class="fixedcard-activebtn" type="button" title="相关推荐" onclick="FixedCardWidget(&quot;class&quot;,&quot;card-recommend-post&quot;,&quot;0&quot;)"><i class="fas fa-dharmachakra"></i></button><div class="fixedcard-user-avatar fixedcard-activebtn" onclick="RemoveFixedCardWidget()"><img class="fixedcard-user-avatar-img" src="" data-lazy-src="https://npm.elemecdn.com/akiblog@1.0.1/img/author.webp" title="Akilar"></div></div><script defer data-pjax src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/fixed_card_widget.js"></script><script defer data-pjax src="https://npm.elemecdn.com/akiblog@1.0.1/js/custom/fixed_comment.js"></script></div><script>var fdata={apiurl:"/json/akifcircle.json",initnumber:20,stepnumber:10,error_img:"https://npm.elemecdn.com/akilar-candyassets/image/404.gif"};localStorage.setItem("fdatalist",JSON.stringify(fdata))</script><script defer src="https://npm.elemecdn.com/hexo-filter-fcircle/assets/js/fetch.js"></script><script data-pjax src="https://npm.elemecdn.com/hexo-filter-gitcalendar/lib/gitcalendar.js"></script><script data-pjax>function gitcalendar_injector_config(){document.getElementById("recent-posts").insertAdjacentHTML("afterbegin",'<div class="recent-post-item" id="gitcalendarBar" style="width:100%;height:auto;padding:10px;"><style>#git_container{min-height: 280px}@media screen and (max-width:650px) {#git_container{min-height: 0px}}</style><div id="git_loading" style="width:10%;height:100%;margin:0 auto;display: block;"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50" xml:space="preserve"><path fill="#d0d0d0" d="M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z" transform="rotate(275.098 25 25)"><animatetransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite"></animatetransform></path></svg><style>#git_container{display: none;}</style></div><div id="git_container"></div></div>'),console.log("已挂载gitcalendar")}document.getElementById("recent-posts")&&"/"===location.pathname&&(gitcalendar_injector_config(),GitCalendarInit("/json/akicalendar.json",["#e4dfd7","#f9f4dc","#f7e8aa","#f7e8aa","#f8df72","#fcd217","#fcc515","#f28e16","#fb8b05","#d85916","#f43e06"],"Akilarlxh"))</script></body></html>